GlobalInterceptorRouter
@MainActor
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
@MainActor public init(router: R)Parameters
routerRouterinstance to proxy. -
Declaration
Swift
@MainActor public func navigate<Context>(to step: DestinationStep<some UIViewController, Context>, with context: Context, animated: Bool, completion: ((RoutingResult) -> Void)?) throws -
Adds
RoutingInterceptorinstance to theGlobalInterceptorRouterDeclaration
Swift
@MainActor public mutating func addGlobal<RI>(_ interceptor: RI) where RI : RoutingInterceptor, RI.Context == Any?Parameters
interceptorThe
RoutingInterceptorinstance to be executed byRouterbefore routing to this step.
-
Declaration
Swift
@MainActor public mutating func add<RI>(_ interceptor: RI) where RI : RoutingInterceptor, RI.Context == Any? -
Declaration
Swift
@MainActor public mutating func add<CT>(_ contextTask: CT) where CT : ContextTask, CT.Context == Any?, CT.ViewController == UIViewController -
Declaration
Swift
@MainActor public mutating func add<PT>(_ postTask: PT) where PT : PostRoutingTask, PT.Context == Any?