ViewControllerBuilder
public protocol ViewControllerBuilder
Type, that is capable of building a ViewController
, given Context
.
-
Type of
View
, that thisViewControllerBuilder
can build.Declaration
Swift
associatedtype ViewType : ViewController
-
Argument type, that
ViewBuilder
needs to build aViewController
.Declaration
Swift
associatedtype Context
-
Builds a
View
using providedContext
or throws an error, if building process was not successfulThrows
Build error, if building process was not successful.Parameters
context
Argument, required to build
ViewController
.Return Value
View
, that was built using providedContext
object. -
embeddedInNavigation(navigationBuilder:
Extension method) Creates a
NavigationSingleViewEmbeddingBuilder
, embedding current view builder in it.Declaration
Swift
public func embeddedInNavigation(navigationBuilder: @escaping () -> UINavigationController = { .init() }) -> NavigationSingleViewEmbeddingBuilder<Self>
Return Value
NavigationSingleViewEmbeddingBuilder
with current builder embedded. -
pushRoute(isAnimated:
Extension method) Creates a route, that uses current builder, creates a view, and pushes it onto current navigation stack.
Declaration
Swift
public func pushRoute(isAnimated: Bool = true) -> Route<Self, PushNavigationTransition>
Parameters
isAnimated
should the navigation push be animated.
Return Value
Route to view built by current builder, that will be pushed onto current navigation stack.
-
presentRoute(isAnimated:
Extension method) Creates a route, that uses current builder, creates a view, and presents it on top of currently visible view.
Declaration
Swift
public func presentRoute(isAnimated: Bool = true) -> Route<Self, PresentationTransition>
Parameters
isAnimated
should the presentation be animated.
Return Value
Route to view built by current builder, that will be presented on top of currently visible view.
-
replace(_:
Extension methodisAnimated: ) Creates a route that uses a current builder, creates a view, and replaces current navigation stack with a newly created view. Remaining viewControllers depend on
behavior
.Declaration
Swift
public func replace(_ behavior: ReplaceNavigationTransition.Behavior = .replaceLast, isAnimated: Bool = true) -> Route<Self, ReplaceNavigationTransition>
Parameters
behavior
Behavior to use when replacing view controllers in navigation stack
isAnimated
should the presentation be animated.
-
with(_:
Extension method) Combines current builder with provided
transition
to create a Route, containing them both.Declaration
Swift
public func with<T>(_ transition: T) -> Route<Self, T> where T : ViewTransition
Parameters
transition
transition to be performed when navigating to created route.
Return Value
Route, that combines current builder and
transition
.
-
asAnyBuilder
Extension methodConverts any
ViewControllerBuilder
with Void context to AnyBuilder, erasing it’s type.Declaration
Swift
public var asAnyBuilder: AnyBuilder { get }
-
build()
Extension method