Router
public struct Router
The Router is the main point that manages showing and hiding views.
When instantiated it requires a configuration that provides it with the various routes and destinations.
-
Possibile errors while performing the routing operations.
See moreDeclaration
Swift
public enum RoutingError -
Initiates a
Routerand returns it with the proper configuration.Declaration
Swift
public init(with configuration: RoutingConfigurationProvider)
-
Sets a new
rootViewControllerfor theUIWindow.Declaration
Swift
public func installRoot(using controller: UIViewController, in window: UIWindow, completion: (() -> Void)? = nil)Parameters
routableThe routable object to install as root.
windowThe window in which to install the root.
completionOptional completion to execute after making the window key and visible. Defaults to nil.
-
Shows the routable elements in the same order they are passed in a synchronous way.
Declaration
Swift
public func show( routableElements: [AnyRoutableObject], completion: RoutingCompletion? = nil )Parameters
routableElementsThe screens to display with their configuration.
completionAn optional completion to execute after presenting all elements. Defaults to nil.
-
Hides the top most view controller.
Declaration
Swift
public func hide(animated: Bool = true, completion: RoutingCompletion? = nil)Parameters
animatedhiding is animated or not. Defaults to
true.completioncompletion to execute after hiding is completed. Defaults to
nil
View on GitHub
Router Structure Reference