Router
open class Router
Object responsible for performing navigation to concrete routes, as well as keeping references to root view provider and view finder.
-
Object responsible for finding view on which route should be performed.
Declaration
Swift
open var viewFinder: ViewFinder -
Object responsible for providing root view of interface hierarchy.
Declaration
Swift
open var rootViewProvider: RootViewProvider -
Creates
RouterwithCurrentlyVisibleViewFinderobject set as aViewFinderinstance.Declaration
Swift
public init(rootViewProvider: RootViewProvider)Parameters
rootViewProviderprovider of the root view of interface.
-
Creates
Routerwith specified root view provider and view finder. -
Returns route, that calls
popViewControllermethod on currently visible navigation controller. No view is getting built in the process of routing.Declaration
Swift
open class func popRoute(isAnimated: Bool = true) -> Route<NonBuilder, PopNavigationTransition>Parameters
isAnimatedshould the transition be animated.
Return Value
performable route.
-
Returns route, that calls
popViewControllermethod on currently visible navigation controller. No view is getting built in the process of routing.Declaration
Swift
open func popRoute(isAnimated: Bool = true) -> Route<NonBuilder, PopNavigationTransition>Parameters
isAnimatedshould the transition be animated.
Return Value
performable route.
-
Returns route, that calls
popToRootViewControllermethod on currently visible navigation controller. No view is getting built in the process of routing.Declaration
Swift
open class func popToRootRoute(isAnimated: Bool = true) -> Route<NonBuilder, PopNavigationTransition>Parameters
isAnimatedshould the transition be animated.
Return Value
performable route.
-
Returns route, that calls
popToViewController(_:animated:)method on currently visible navigation controller. No view is getting built in the process of routing. First instance oftypeview controllers available in navigation stack is selectedDeclaration
Swift
open class func popToFirstInstanceOf(_ type: UIViewController.Type, isAnimated: Bool = true) -> Route<NonBuilder, PopNavigationTransition>Parameters
typetype of view controller to search for in navigation stack
isAnimatedshould the transition be animated.
-
Returns route, that calls
popToViewController(_:animated:)method on currently visible navigation controller. No view is getting built in the process of routing. First instance oftypeview controllers available in navigation stack is selectedDeclaration
Swift
open func popToFirstInstanceOf(_ type: UIViewController.Type, isAnimated: Bool = true) -> Route<NonBuilder, PopNavigationTransition>Parameters
typetype of view controller to search for in navigation stack
isAnimatedshould the transition be animated.
-
Returns route, that calls
popToViewController(_:animated:)method on currently visible navigation controller. No view is getting built in the process of routing. Last instance oftypeview controllers available in navigation stack is selected.Declaration
Swift
open class func popToLastInstanceOf(_ type: UIViewController.Type, isAnimated: Bool = true) -> Route<NonBuilder, PopNavigationTransition>Parameters
typetype of view controller to search for in navigation stack
isAnimatedshould the transition be animated.
-
Returns route, that calls
popToViewController(_:animated:)method on currently visible navigation controller. No view is getting built in the process of routing. Last instance oftypeview controllers available in navigation stack is selected.Declaration
Swift
open func popToLastInstanceOf(_ type: UIViewController.Type, isAnimated: Bool = true) -> Route<NonBuilder, PopNavigationTransition>Parameters
typetype of view controller to search for in navigation stack
isAnimatedshould the transition be animated.
-
Returns route, that calls
popToRootViewControllermethod on currently visible navigation controller. No view is getting built in the process of routing.Declaration
Swift
open func popToRootRoute(isAnimated: Bool = true) -> Route<NonBuilder, PopNavigationTransition>Parameters
isAnimatedshould the transition be animated.
Return Value
performable route.
-
Returns route, that calls
dismissmethod on currently visible view controller. No view is getting built in the process of routing.Declaration
Swift
open class func dismissRoute(isAnimated: Bool = true) -> Route<NonBuilder, DismissTransition>Parameters
isAnimatedshould the transition be animated.
Return Value
performable route.
-
Returns route, that calls
dismissmethod on currently visible view controller. No view is getting built in the process of routing.Declaration
Swift
open func dismissRoute(isAnimated: Bool = true) -> Route<NonBuilder, DismissTransition>Parameters
isAnimatedshould the transition be animated.
Return Value
performable route.
-
Performs navigation to
routeusing providedcontextand callingcompletiononce routing process is completed.Declaration
Swift
open func navigate<T: Routable>(to route: T, with context: T.Builder.Context, completion: ((Bool) -> Void)? = nil)Parameters
routeroute to navigate to.
contextobject that will be used to build view to navigate to, if needed.
completionwill be called once routing is completed.
-
Performs navigation to
routeand callscompletiononce routing process is completed.Declaration
Swift
open func navigate<T: Routable>(to route: T, completion: ((Bool) -> Void)? = nil) where T.Builder.Context == VoidParameters
routeroute to navigate to.
completionwill be called once routing is completed.
View on GitHub
Install in Dash
Router Class Reference