Extras
-
See moreDestinationinstance represents both final screen configuration and the data to provide. It is useful when there is a need to wrap both values into a single DTO value.Declaration
Swift
@MainActor public struct Destination<VC, C> where VC : UIViewController -
AnyDestinationrepresents a genericDestinationthat contains the screen configuration for any type ofUIViewControllerand the context of any type.Declaration
Swift
public typealias AnyDestination = Destination<UIViewController, Any?> -
See moreInlineStackIteratingFinder. Might be useful for the configuration testing.Declaration
Swift
@MainActor public struct InlineStackIteratingFinder<VC, C> : StackIteratingFinder where VC : UIViewController -
InlineInterceptorNB: It may be used for the purpose of configuration testing, but then replaced with a strongly typed
See moreRoutingInterceptorinstance.Declaration
Swift
@MainActor public struct InlineInterceptor<C> : RoutingInterceptor -
InlineContextTaskNB: It may be used for the purpose of configuration testing, but then replaced with a strongly typed
See moreContextTaskinstance.Declaration
Swift
@MainActor public struct InlineContextTask<VC, C> : ContextTask where VC : UIViewController -
InlinePostTaskis the inline context task.NB: It may be used for the purpose of configuration testing, but then replaced with a strongly typed
See morePostRoutingTaskinstance.Declaration
Swift
@MainActor public struct InlinePostTask<VC, C> : PostRoutingTask where VC : UIViewController -
NavigationDelayingInterceptordelays 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 thanRouteComposeror 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:
See moreUIKitdoes not allow simultaneous changes inUIViewControllerstack. The.waitstrategy does not guarantee 100% protection from all possible situations. The code must be written in a way that avoids such situations. The.waitstrategy can be used only as a temporary solution.Declaration
Swift
@MainActor public struct NavigationDelayingInterceptor<Context> : RoutingInterceptor -
The
Routerproxy guarantees that not more than one navigation will happen simultaneously.It is useful to avoid situations when the application can not control the amount of navigations (for example, a navigation triggered by the push notifications)
See moreDeclaration
Swift
@MainActor public struct SingleNavigationRouter<R> : Router where R : Routerextension SingleNavigationRouter: InterceptableRouter where R: InterceptableRouter -
The
See moreDefaultRoutersearches 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.GlobalInterceptorRouterproxy allows to add such a global interceptor that will be executed before any work thatDefaultRouterwill do.Declaration
Swift
@MainActor public struct GlobalInterceptorRouter<R> : Router where R : Routerextension GlobalInterceptorRouter: InterceptableRouter where R: InterceptableRouter -
See moreContextTaskthat simplifies setting of the context to theUIViewControllerthat implementsContextAcceptingprotocol.Declaration
Swift
@MainActor public struct ContextSettingTask<VC> : ContextTask where VC : ContextAccepting -
The protocol for a
See moreUIViewControllerto make it compatible withContextSettingTask.Declaration
Swift
@MainActor public protocol ContextAccepting : UIViewController -
The protocol for a
Viewto make it compatible withContextSettingTask.Due to some current
See moreswiftlimitations protocolContextAcceptingcan not be used directly.Declaration
Swift
@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) @MainActor public protocol ContextAcceptingView -
See moreViewinstance should conform to this protocol to be used withUIHostingControllerWithContextFactoryDeclaration
Swift
@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) @MainActor public protocol ContextInstantiatable : View -
A default implementation of the view controllers finder, that searches for a view controller by its name and its
Contextinstance.The view controller should conform to the
See moreContextCheckingto be used with this finder.Declaration
Swift
@MainActor public struct ClassWithContextFinder<VC, C> : StackIteratingFinder where VC : UIViewController, VC : ContextChecking, C == VC.Context -
See moreUIViewControllerinstance should conform to this protocol to be used withClassWithContextFinderDeclaration
Swift
@MainActor public protocol ContextChecking -
See moreDismissalMethodProvidingContextTaskallows to provide the way to dismiss theUIViewControllerusing a preset configuration. TheUIViewControllershould conform toDismissibleprotocol and callDismissible.dismissViewController(...)method when it needs to be dismissed to trigger the dismissal process implemented inDismissalMethodProvidingContextTask.init(...)constructor.Declaration
Swift
@MainActor public struct DismissalMethodProvidingContextTask<VC, C> : ContextTask where VC : Dismissible -
See moreUIViewControllershould conform toDismissibleprotocol to be used withDismissalMethodProvidingContextTask.Declaration
Swift
@MainActor public protocol Dismissible : UIViewController
-
See moreDismissibleWithRuntimeStoragesimplifiesDismissibleprotocol conformance implementing requireddismissalBlockusing Objective C runtime.Declaration
Swift
@MainActor public protocol DismissibleWithRuntimeStorage : Dismissible -
Extension that wraps an action into
CATransaction.When
DefaultRouterbuilds a complicated chain of animated modifications in theUIViewControllers stack it might be necessary to wrap some actions into singleCATransaction.Example: When
See moreUINavigationControllerdoes pop, then push of theUIViewControllerand then tries to do some to it or find it with aFinder. ThenDefaultRouterhas to wait till the end of the animation.Declaration
Swift
public extension CATransaction -
Extension that wraps actions into
DispatchQueueand delays it for the provided time interval.Can be used to test action implementation or the configuration issues.
See moreDeclaration
Swift
public extension DispatchQueue
Extras Reference