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.
-
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
-
Creates an instance of this view. Required.
Declaration
Swift
init()
-
viewModel
Extension methodThe 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 }
-
coordinated(by:)
Extension methodCall 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