AnyCoordinator

public class AnyCoordinator<RouteType, TransitionType> : Coordinator where RouteType : Route, TransitionType : TransitionProtocol

AnyCoordinator is a type-erased Coordinator (RouteType & TransitionType) and can be used as an abstraction from a specific coordinator class while still specifying TransitionType and RouteType.

Note

If you do not want/need to specify TransitionType, you might want to look into the different router abstractions StrongRouter, UnownedRouter and WeakRouter. See AnyTransitionPerformer to further abstract from RouteType.
  • Creates a type-erased Coordinator for a specific coordinator.

    A strong reference to the source coordinator is kept.

    Declaration

    Swift

    public init<C>(_ coordinator: C) where RouteType == C.RouteType, TransitionType == C.TransitionType, C : Coordinator

    Parameters

    coordinator

    The source coordinator.

  • Declaration

    Swift

    public var rootViewController: TransitionType.RootViewController { get }
  • Declaration

    Swift

    public var viewController: UIViewController! { get }