ScreenRoute

public struct ScreenRoute<
    Root: ScreenContainer,
    Current: ScreenContainer
>: ScreenThenable
extension ScreenRoute: ScreenRouteConvertible

A route that describes navigation as a set of actions.

  • Declaration

    Swift

    public var actions: [AnyScreenAction<Root, Void>] { get }
  • Declaration

    Swift

    public func then(_ actions: [AnyScreenAction<Current, Void>]) -> ScreenRoute<Root, Current>
  • Declaration

    Swift

    public func then<Action: ScreenAction>(
        _ action: Action
    ) -> Self where Action.Container == Current
  • Declaration

    Swift

    public func then<Route: ScreenThenable>(
        _ other: Route
    ) -> Self where Route.Root == Current
  • Returns the root route with the actions of the current instance.

    Declaration

    Swift

    public func resolve() -> ScreenRootRoute<Root>

    Return Value

    An instance containing all the actions.

  • Undocumented

    Declaration

    Swift

    public func route<Container>() -> ScreenRootRoute<Container> where Container : ScreenContainer

Available where Root == Current

  • Returns an empty initial instance of the route.

    Declaration

    Swift

    public static var initial: `Self` { get }
  • Creates a route with initial actions.

    Declaration

    Swift

    public init(actions: [AnyScreenAction<Current, Void>] = [])

    Parameters

    actions

    Set of the initial actions of the route.

  • Creates a route with initial action.

    Declaration

    Swift

    public init<Action>(action: Action) where Current == Action.Container, Action : ScreenAction

    Parameters

    action

    Initial action of the route.

  • Creates a route with initial actions added in the closure.

    Declaration

    Swift

    public init(_ route: (_ route: ScreenRootRoute<Root>) throws -> ScreenRouteConvertible) rethrows

    Parameters

    route

    The closure that should return the modified route.