GlobalInterceptorRouter
public struct GlobalInterceptorRouter<R> : Router where R : Router
extension GlobalInterceptorRouter: InterceptableRouter where R: InterceptableRouter
The DefaultRouter
searches for the view controller as a starting point before it starts to run interceptors.
Sometimes if interceptor can change the entire stack of view controllers it is handy to run a global interceptor
any starting point is found. GlobalInterceptorRouter
proxy allows to add such a global interceptor that will be
executed before any work that DefaultRouter
will do.
-
Constructor
Declaration
Swift
public init(router: R)
Parameters
router
Router
instance to proxy. -
Declaration
Swift
public func navigate<Context>(to step: DestinationStep<some UIViewController, Context>, with context: Context, animated: Bool, completion: ((RoutingResult) -> Void)?) throws
-
Adds
RoutingInterceptor
instance to theGlobalInterceptorRouter
Declaration
Swift
public mutating func addGlobal<RI>(_ interceptor: RI) where RI : RoutingInterceptor, RI.Context == Any?
Parameters
interceptor
The
RoutingInterceptor
instance to be executed byRouter
before routing to this step.
-
Declaration
Swift
public mutating func add<RI>(_ interceptor: RI) where RI : RoutingInterceptor, RI.Context == Any?
-
Declaration
Swift
public mutating func add<CT>(_ contextTask: CT) where CT : ContextTask, CT.Context == Any?, CT.ViewController == UIViewController
-
Declaration
Swift
public mutating func add<PT>(_ postTask: PT) where PT : PostRoutingTask, PT.Context == Any?