NavigationDelayingInterceptor
@MainActor
public struct NavigationDelayingInterceptor<Context> : RoutingInterceptor
NavigationDelayingInterceptor delays the router from starting the navigation, while any view controllers in the
stack are being presented or dismissed. In case your app has some other navigation instruments rather than
RouteComposer or you have a situation when a few routers work simultaneously, add it to your router to avoid
the router not being able to navigate to the destination because a view controller in the stack is
being presented or dismissed.
NB: UIKit does not allow simultaneous changes in UIViewController stack. The .wait strategy does not
guarantee 100% protection from all possible situations. The code must be written in a way that avoids such
situations. The .wait strategy can be used only as a temporary solution.
-
WindowProviderinstance.Declaration
Swift
@MainActor public let windowProvider: WindowProvider -
Declaration
Swift
@MainActor public let strategy: NavigationDelayingInterceptorStrategy
-
Constructor
Declaration
Swift
@MainActor public init(strategy: NavigationDelayingInterceptorStrategy = .abort, windowProvider: WindowProvider = RouteComposerDefaults.shared.windowProvider, logger: Logger? = RouteComposerDefaults.shared.logger)Parameters
windowProviderWindowProviderinstance.strategyType of
Strategyto be used.loggerLoggerinstance. -
Declaration
Swift
@MainActor public func perform(with context: Context, completion: @escaping (RoutingResult) -> Void)