Protocols
The following protocols are available globally.
-
Type, that is capable of building a
See moreViewController
, givenContext
.Declaration
Swift
public protocol ViewControllerBuilder
-
Type, responsible for finding currently visible view in existing view hierarchy.
See moreDeclaration
Swift
public protocol ViewFinder
-
Type that is responsible for providing root view in current view hierarchy.
Note
on iOS and tvOS, commonly, the root provider is UIWindow via UIApplication.shared.keyWindow, however there are scenarios where keyWindow might not be accessible, for example in iMesssage apps and application extensions. In those cases you can use root view controller that is accessible in those context, for example in iMessage extensions this could beMSMessagesAppViewController
, or view controller presented on top of it. Also, your app might have several UIWindow objects working in the same time, for example when app is using AirPlay, or ifUIWindow
s are used to present different interfaces modally. In those cases it’s recommended to have multipleRouter
objects with differentRootViewProvider
s.Declaration
Swift
public protocol RootViewProvider
-
Type, that is capable of performing route from current screen to another one. One example of such type is Route
See moretype, that includes necessary builder to build next visible view, and transition object, that will perform a transition. Declaration
Swift
public protocol Routable
-
Type, that can be updated with newly received
See moreContext
Declaration
Swift
public protocol ContextUpdatable
-
Object, that searches view hierarchy to find
See moreView
, that can be updated with providedContext
.Declaration
Swift
public protocol UpdatableViewFinder
-
Type, that is responsible for making a transition between views.
See moreDeclaration
Swift
public protocol ViewTransition