RouteTransition

public class RouteTransition
extension RouteTransition: Equatable

The types of presentation transitions for Routes.

let myTransition = RouteTransition { (source, destination, animated, completion) in
    source.present
}

Built-in Transitions

  • Automatically infer an appropriate transition from the current context.

    Declaration

    Swift

    static let automatic: RouteTransition
  • Uses UIViewController(_:).present(_:animated:completion:).

    Declaration

    Swift

    static let modal: RouteTransition
  • Uses UINavigationController(_:).pushViewController(_:animated:)if the destination view controller is not already in the navigation hierachy, otherwise it will use UINavigationController(_:).setViewControllers(to:animated:).

    Push the view controller (or pop to it if it is already in the stack).

    Note

    This transition can only be used when you are navigating from a UINavigationController.

    Declaration

    Swift

    static let push: RouteTransition
  • Clear the stack and replace it with the destination view controller.

    Uses UINavigationController(_:).setViewControllers(to:animated:).

    Note

    This transition can only be used when you are navigating from a UINavigationController.

    If the view controller is currently in the stack, but is not the topmost item, this method uses a pop transition; if it is the topmost item, no transition is performed. If the view controller is not on the stack, this method uses a push transition.

    Declaration

    Swift

    static let replace: RouteTransition
  • Uses identity for equality check.

    Declaration

    Swift

    public static func == (lhs: RouteTransition, rhs: RouteTransition) -> Bool