MwxView

public protocol MwxView : View

A piece of user interface.

You create custom views by declaring types that conform to the MwxView protocol. Implement the required body property to provide the content and behavior for your custom view. Implement the required vm property to provide the view model.

Associatedtypes

  • VM

    The type of view model for this view.

    When you create a custom view, Swift infers this type from your implementation of the required vm property.

    Declaration

    Swift

    associatedtype VM

View Model

  • vm

    Declares the view model of this view.

    Declaration

    Swift

    var vm: VM { get }

Initialization

  • Creates an instance of this view. Required.

    Declaration

    Swift

    init()

View Model

  • viewModel Extension method

    The type of view model for this view.

    When you create a custom view, Swift infers this type from your implementation of the required vm property.

    Declaration

    Swift

    weak var viewModel: MwxViewModel<Self>? { get }

View Wrappers

  • coordinated(by:) Extension method

    Call this function to wrap up the view model for this view with its current coordinator.

    Declaration

    Swift

    func coordinated(by coordinator: AnyCoordinator?) -> some MwxView

    Parameters

    coordinator

    A AnyCoordinator indicates the coordinator for this view.

    Return Value

    The wrapped up view for this coordinator.

  • with(_:) Extension method

    Call this function to wrap up the view model for this view with its input data store.

    Declaration

    Swift

    func with(_ input: MwxInput?) -> some MwxView

    Parameters

    input

    A MwxInput indicates the input data store of the coordinator.

    Return Value

    The wrapped up view for this input.