UpdatingRoute

open class UpdatingRoute<Finder: UpdatableViewFinder, Builder: ViewControllerBuilder, Transition: ViewTransition>: Route<Builder, Transition>
    where Builder.ViewType: ContextUpdatable,
        Builder.Context == Finder.ViewType.Context,
        Finder.Context == Builder.Context,
        Finder.ViewType == Builder.ViewType

Subclass of Route, that allows view to be updated instead of creating a new one to transition to.

  • Object, responsible for finding view to update.

    Declaration

    Swift

    public let updatableViewFinder: Finder
  • Creates UpdatingRoute.

    Declaration

    Swift

    public init(updatableViewFinder: Finder, builder: Builder, transition: Transition)

    Parameters

    updatableViewFinder

    Object, responsible for finding view to update.

    builder

    Object, responsible for building a view, that is needed for routing.

    transition

    Object, that is responsible for performing a transition between views.

  • Performs route between views. If updatable view is found, it’s updated with newly received context. If it’s not found, this method calls superclass method and behaves as a Route object.

    Declaration

    Swift

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

    Parameters

    viewFinder

    Object, responsible for providing currently visible view.

    context

    object that will be used to build view to navigate to, if needed.

    completion

    will be called once routing is completed.