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
updatableViewFinderObject, responsible for finding view to update.
builderObject, responsible for building a view, that is needed for routing.
transitionObject, 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
Routeobject.Declaration
Swift
open override func perform(withViewFinder viewFinder: ViewFinder, context: Builder.Context, completion: ((Bool) -> Void)?)Parameters
viewFinderObject, responsible for providing currently visible view.
contextobject that will be used to build view to navigate to, if needed.
completionwill be called once routing is completed.
View on GitHub
Install in Dash
UpdatingRoute Class Reference