BasicCoordinator
open class BasicCoordinator<RouteType, TransitionType> : BaseCoordinator<RouteType, TransitionType> where RouteType : Route, TransitionType : TransitionProtocol
BasicCoordinator is a coordinator class that can be used without subclassing.
Although subclassing of coordinators is encouraged for more complex cases, a BasicCoordinator can easily
be created by only providing a prepareTransition closure, an initialRoute and an initialLoadingType.
-
See moreInitialLoadingTypedifferentiates between different points in time when the initital route is to be triggered by the coordinator.Declaration
Swift
public enum InitialLoadingType
-
Creates a BasicCoordinator.
Seealso
See
InitialLoadingTypefor more information.Declaration
Swift
public init(rootViewController: RootViewController, initialRoute: RouteType? = nil, initialLoadingType: InitialLoadingType = .presented, prepareTransition: ((RouteType) -> TransitionType)?)Parameters
initialRouteIf a route is specified, it is triggered depending on the initialLoadingType.
initialLoadingTypeThe initialLoadingType specifies when the initialRoute is triggered.
prepareTransitionA closure to define transitions based on triggered routes. Make sure to override
prepareTransitionby subclassing, if you specifynilhere.
-
This method is called whenever the BasicCoordinator is shown to the user.
If
initialLoadingTypehas been specified aspresentedand an initialRoute is present, the route is triggered here.Declaration
Swift
open override func presented(from presentable: Presentable?)Parameters
presentableThe context in which this coordinator has been shown to the user.
-
Declaration
Swift
open override func prepareTransition(for route: RouteType) -> TransitionType
View on GitHub
BasicCoordinator Class Reference