Classes
The following classes are available globally.
-
Animation
is used to set presentation and dismissal animations for presentables.Depending on the transition in use, different properties of a
UIViewController
are set to make sure the transition animation is used.Note
To not override the previously set
Animation
, usenil
when initializing a transition.Make sure to hold a strong reference to the
Animation
object, as it is only held by a weak reference.Declaration
Swift
open class Animation : NSObject
-
AnyCoordinator
is a type-erasedCoordinator
(RouteType
&TransitionType
) and can be used as an abstraction from a specific coordinator class while still specifying TransitionType and RouteType.Note
If you do not want/need to specify TransitionType, you might want to look into the different router abstractionsStrongRouter
,UnownedRouter
andWeakRouter
. SeeAnyTransitionPerformer
to further abstract from RouteType.Declaration
Swift
public class AnyCoordinator<RouteType, TransitionType> : Coordinator where RouteType : Route, TransitionType : TransitionProtocol
-
AnyTransitionPerformer can be used as an abstraction from a specific TransitionPerformer implementation without losing type information about its TransitionType.
This type abstraction can be especially helpful when performing transitions. AnyTransitionPerformer abstracts away any implementation specific details and reduces coordinators to the capabilities of the
See moreTransitionPerformer
protocol.Declaration
Swift
public class AnyTransitionPerformer<TransitionType> : TransitionPerformer where TransitionType : TransitionProtocol
-
BaseCoordinator can (and is encouraged to) be used as a superclass for any custom implementation of a coordinator.
It is also encouraged to use already provided subclasses of BaseCoordinator such as
See moreNavigationCoordinator
,TabBarCoordinator
,ViewCoordinator
,SplitCoordinator
andPageCoordinator
.Declaration
Swift
open class BaseCoordinator<RouteType, TransitionType> : Coordinator where RouteType : Route, TransitionType : TransitionProtocol
-
BasicCoordinator is a coordinator class that can be used without subclassing.
Although subclassing of coordinators is encouraged for more complex cases, a
See moreBasicCoordinator
can easily be created by only providing aprepareTransition
closure, aninitialRoute
and aninitialLoadingType
.Declaration
Swift
open class BasicCoordinator<RouteType, TransitionType> : BaseCoordinator<RouteType, TransitionType> where RouteType : Route, TransitionType : TransitionProtocol
-
InteractiveTransitionAnimation
provides a simple interface to create interactive transition animations.An
InteractiveTransitionAnimation
can be created by providing the duration, the animation code and (optionally) a closure to create an interaction controller.Note
To get further information read the UIKit documentation of UIViewControllerAnimatedTransitioning, UIViewControllerInteractiveTransitioning, UIViewControllerContextTransitioning and UIPercentDrivenInteractiveTransition.Declaration
Swift
open class InteractiveTransitionAnimation : NSObject, TransitionAnimation
-
Use InterruptibleTransitionAnimation to define interactive transitions based on the UIViewPropertyAnimator APIs introduced in iOS 10.
See moreDeclaration
Swift
@available(iOS 10.0, *) open class InterruptibleTransitionAnimation : InteractiveTransitionAnimation
-
NavigationAnimationDelegate is used as the delegate of a NavigationCoordinator’s rootViewController to allow for push-transitions to specify animations.
NavigationAnimationDelegate conforms to the
UINavigationControllerDelegate
protocol and is intended for use as the delegate of one navigation controller only.Note
Do not override the delegate of a NavigationCoordinator’s rootViewController. Instead use the delegate property of the NavigationCoordinator itself.Declaration
Swift
open class NavigationAnimationDelegate : NSObject
-
NavigationCoordinator acts as a base class for custom coordinators with a
UINavigationController
as rootViewController.NavigationCoordinator especially ensures that transition animations are called, which would not be the case when creating a
See moreBaseCoordinator<RouteType, NavigationTransition>
.Declaration
Swift
open class NavigationCoordinator<RouteType> : BaseCoordinator<RouteType, NavigationTransition> where RouteType : Route
-
PageCoordinator provides a base class for your custom coordinator with a
UIPageViewController
rootViewController.Note
PageCoordinator sets the dataSource of the rootViewController to reflect the parameters in the initializer.Declaration
Swift
open class PageCoordinator<RouteType> : BaseCoordinator<RouteType, PageTransition> where RouteType : Route
-
PageCoordinatorDataSource is a UIPageViewControllerDataSource implementation with a rather static list of pages.
It further allows looping through the given pages. When looping is active the pages are wrapped around in the given presentables array. When the user navigates beyond the end of the specified pages, the pages are wrapped around by displaying the first page. In analogy to that, it also wraps to the last page when navigating beyond the beginning.
See moreDeclaration
Swift
open class PageCoordinatorDataSource : NSObject, UIPageViewControllerDataSource
-
RedirectionRouters can be used to extract routes into different route types. Instead of having one huge route and one or more huge coordinators, you can create separate redirecting routers.
Create a RedirectionRouter from a parent router by providing a reference to that parent. Triggered routes of the RedirectionRouter will be redirected to this parent router according to the provided mapping. Please provide either a
map
closure in the initializer or override themapToParentRoute
method.A RedirectionRouter has a viewController which is used in transitions, e.g. when you are presenting, pushing, or otherwise displaying it.
See more
-
SplitCoordinator can be used as a basis for a coordinator with a rootViewController of type
UISplitViewController
.You can use all
See moreSplitTransitions
and get an initializer to set a master and (optional) detail presentable.Declaration
Swift
open class SplitCoordinator<RouteType> : BaseCoordinator<RouteType, SplitTransition> where RouteType : Route
-
StaticTransitionAnimation
can be used to realize static transition animations.Note
Consider usingInteractiveTransitionAnimation
instead, if possible, as it is as simple to use. However, this class is helpful to make sure your transition animation is not mistaken to be interactive, if your animation code does not fulfill the requirements of an interactive transition animation.Declaration
Swift
open class StaticTransitionAnimation : NSObject, TransitionAnimation
-
StrongRouter is a type-erasure of a given Router object and, therefore, can be used as an abstraction from a specific Router implementation without losing type information about its RouteType.
StrongRouter abstracts away any implementation specific details and essentially reduces them to properties specified in the
Router
protocol.Note
Do not hold a reference to any router from the view hierarchy. UseUnownedRouter
orWeakRouter
in your view controllers or view models instead. You can create them using theCoordinator.unownedRouter
andCoordinator.weakRouter
properties.
-
TabBarAnimationDelegate is used as the delegate of a TabBarCoordinator’s rootViewController to allow for transitions to specify transition animations.
TabBarAnimationDelegate conforms to the
UITabBarControllerDelegate
protocol and is intended for use as the delegate of one tabbar controller only.Note
Do not override the delegate of a TabBarCoordinator’s rootViewController-delegate. Instead use the delegate property of the TabBarCoordinator itself.Declaration
Swift
open class TabBarAnimationDelegate : NSObject
-
Use a TabBarCoordinator to coordinate a flow where a
See moreUITabbarController
serves as a rootViewController. With a TabBarCoordinator, you get access to all tabbarController-related transitions.Declaration
Swift
open class TabBarCoordinator<RouteType> : BaseCoordinator<RouteType, TabBarTransition> where RouteType : Route
-
ViewCoordinator is a base class for custom coordinators with a
See moreUIViewController
rootViewController.Declaration
Swift
open class ViewCoordinator<RouteType> : BaseCoordinator<RouteType, ViewTransition> where RouteType : Route