NavigationDelayingInterceptor
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.
-
The strategy to be used by
NavigationDelayingInterceptor
- wait: Wait while some
UIViewController
is being presented or dismissed. - abort: Abort tha navigation if some
UIViewController
is being presented or dismissed.
Declaration
Swift
public enum Strategy
- wait: Wait while some
-
WindowProvider
instance.Declaration
Swift
public let windowProvider: WindowProvider
-
Constructor
Declaration
Swift
public init(windowProvider: WindowProvider = RouteComposerDefaults.shared.windowProvider, strategy: Strategy = .abort, logger: Logger? = RouteComposerDefaults.shared.logger)
Parameters
windowProvider
WindowProvider
instance.strategy
Type of
Strategy
to be used.logger
Logger
instance. -
Declaration
Swift
public func perform(with context: Context, completion: @escaping (RoutingResult) -> Void)