ChainableRoute

open class ChainableRoute<T, U> : Routable where T : Routable, U : Routable

Routable type, that can be used to chain multiple Route objects. This is useful, for example, if you want to hide one View, and then immediately after hiding completes, show a different one.

  • ChainableRoute builder is identical to first route builder

    Declaration

    Swift

    public typealias Builder = T.Builder
  • First route in the chain

    Declaration

    Swift

    public let headRoute: T
  • Other routes in the chain

    Declaration

    Swift

    public let tailRoute: U
  • Context, that will be used to build next View in the chain

    Declaration

    Swift

    public let tailContext: U.Builder.Context
  • Returns headRoute builder

    Declaration

    Swift

    public var builder: T.Builder { get }
  • Returns NonTransition instance.

    Declaration

    Swift

    public var transition: NonTransition { get }
  • Creates chain from two routes, by placing them in a headRoute and tailRoute.

    Declaration

    Swift

    public init(headRoute: T, tailRoute: U, tailContext: U.Builder.Context)

    Parameters

    headRoute

    Route to be performed first

    tailRoute

    Route to be performed next in the chain

    tailContext

    Context required to build view for next route in the chain

  • Performs headRoute, and once it completes, follows it with tailRoute, and once that is completed, calls completion closure.

    Declaration

    Swift

    open func perform(withViewFinder viewFinder: ViewFinder, context: T.Builder.Context, completion: ((Bool) -> Void)?)

    Parameters

    viewFinder

    object responsible for finding view on which route should be performed.

    context

    object that will be used to build view to navigate to, if needed. In this case, it’s context for headRoute.

    completion

    will be called once head and tail routes are completed.