DestinationStep

public struct DestinationStep<VC, C> : RoutingStep, ChainableStep where VC : UIViewController

Represents a single step for the Router to make.

Associated types

  • Type of the ViewController associated with the step

    Declaration

    Swift

    public typealias ViewController = VC
  • Type of the Context associated with the step

    Declaration

    Swift

    public typealias Context = C

Methods

  • Adapts context and view controller type dependencies.

    NB: Developer guaranties that this types will compliment in runtime.

    Declaration

    Swift

    public func unsafelyRewrapped<NewVC, NewC>() -> DestinationStep<NewVC, NewC> where NewVC : UIViewController
  • Transforms context using ContextTransformer provided.

    Declaration

    Swift

    public func adaptingContext<T>(using contextTransformer: T) -> DestinationStep<VC, T.SourceContext> where C == T.TargetContext, T : ContextTransformer
  • Allows to avoid container view controller check.

    NB: Developer guaranties that it will be there in the runtime.

    Declaration

    Swift

    public func expectingContainer<NewVC>() -> DestinationStep<NewVC, Context> where NewVC : ContainerViewController

Available where DestinationStep.Context == Any?

  • Allows to avoid container view controller check. This method is available only for the steps that are able to accept any type of context.

    NB: Developer guaranties that it will be there in the runtime.

    Declaration

    Swift

    func expectingContainer<NewVC, NewC>() -> DestinationStep<NewVC, NewC> where NewVC : ContainerViewController
  • Allows to compliment to the type check. A step that has context equal to Optional(Any) can be build with any type of context passed to the router.

    Declaration

    Swift

    func adaptingContext<NewC>() -> DestinationStep<ViewController, NewC>