AnyCoordinator

public protocol AnyCoordinator

You conform to the AnyCoordinator protocol to define the coordinator that manages the navigation lifecycle of a view by coordinating its corresponding view model. Implement the required viewModelType property to provide the view model type.

Behaviour

  • The presentation use by the coordinator to present the view for the corresponding view model.

    Declaration

    Swift

    var presentation: MwxPresentation { get set }
  • The input used to initialize this view model and passed from presenting view models.

    Declaration

    Swift

    var input: MwxInput? { get set }
  • The callback closure that is invoked when the view for the corresponding view model disappears.

    Declaration

    Swift

    var onDisappear: (() -> Void)? { get set }

Relationship

  • The managing coordinator that presented and is used to manage the current coordinator.

    Declaration

    Swift

    var managingCoordinator: AnyCoordinator? { get set }

View Factory

  • The view that is of the coordinator manages its navigation lifecycle by coordinating its corresponding view model.

    Declaration

    Swift

    var view: AnyView { get }

Public Navigation

  • Call this function to show the coordinator by changing its activator state property.

    Note

    Only works with link and sheet coordinators.

    Declaration

    Swift

    func show()
  • Call this function to show the coordinator by changing its activator state property.

    Note

    Only works with link and sheet coordinators.

    Declaration

    Swift

    func show(with input: MwxInput?)

    Parameters

    input

    A MwxInput indicates the input data store of the coordinator.

  • Call this function to deactivate the coordinator by changing its activator state property.

    Note

    Only works with link coordinators.

    Declaration

    Swift

    func pop()
  • Call this function to deactivate the coordinator by changing its activator state property.

    Note

    Only works with sheet coordinators.

    Declaration

    Swift

    func dismiss()
  • Call this function to select the tab coordinator by changing its selection state property.

    Note

    Works with current tab coordinator or its managing coordinator hierarchy.

    Declaration

    Swift

    func select(tab selection: Int)

    Parameters

    selection

    A Int indicates the index tag of the selected tab view item.

Internal Navigation

  • Call this function to deactivate the coordinator by changing its activator state property.

    Declaration

    Swift

    func deactivate()
  • Call this function to select the tab coordinator by changing its selection state property.

    Note

    Only works with the current tab coordinator.

    Declaration

    Swift

    func setSelection(tab selection: Int)

    Parameters

    selection

    A Int indicates the index tag of the selected tab view item.