StepAssembly
@MainActor
public final class StepAssembly<F: Finder, FC: AbstractFactory>: GenericStepAssembly<F.ViewController, FC.Context>
where
F.ViewController == FC.ViewController, F.Context == FC.Context
Builds a DestinationStep
instance with the correct settings into a chain of steps.
NB
Both Finder
and Factory
instances should deal with the same type of UIViewController
and Context
instances.
Usage
let productScreen = StepAssembly(finder: ProductViewControllerFinder(), factory: ProductViewControllerFactory())
.adding(LoginInterceptor())
.adding(ProductViewControllerContextTask())
.adding(ProductViewControllerPostTask(analyticsManager: AnalyticsManager.sharedInstance))
.using(.push)
.from(.navigationController)
.using(.present)
.from(.current)
.assemble()
-
Enables shorthand
.using(.present(...))
by providing a concrete expected type.Declaration
Swift
@MainActor final func using(_ action: ViewControllerActions.PresentModallyAction) -> StepChainAssembly<ViewController, Context>
-
Enables shorthand
.using(.replaceRoot(...))
Declaration
Swift
@MainActor final func using(_ action: ViewControllerActions.ReplaceRootAction) -> StepChainAssembly<ViewController, Context>
-
Enables shorthand
.using(.nilAction)
Declaration
Swift
@MainActor final func using(_ action: ViewControllerActions.NilAction) -> StepChainAssembly<ViewController, Context>
-
Enables shorthand
.using(.presentModally(...))
by providing a concrete expected type.Declaration
Swift
@MainActor final func using(_ action: ViewControllerActions.PresentModallyAction) -> StepChainAssembly<ViewController, Context>
-
Enables shorthand
.using(.replaceRoot(...))
Declaration
Swift
@MainActor final func using(_ action: ViewControllerActions.ReplaceRootAction) -> StepChainAssembly<ViewController, Context>
-
Enables shorthand
.using(.nilAction)
Declaration
Swift
@MainActor final func using(_ action: ViewControllerActions.NilAction) -> StepChainAssembly<ViewController, Context>
-
Enables shorthand
.using(.push)
by providing a concrete expected type.Declaration
Swift
@MainActor final func using(_ action: NavigationControllerActions.PushAction<UINavigationController>) -> ContainerStepChainAssembly<UINavigationController, ViewController, Context>
-
Enables shorthand
.using(.pushAsRoot)
Declaration
Swift
@MainActor final func using(_ action: NavigationControllerActions.PushAsRootAction<UINavigationController>) -> ContainerStepChainAssembly<UINavigationController, ViewController, Context>
-
Enables shorthand
.using(.pushReplacingLast)
Declaration
Swift
@MainActor final func using(_ action: NavigationControllerActions.PushReplacingLastAction<UINavigationController>) -> ContainerStepChainAssembly<UINavigationController, ViewController, Context>
-
Enables shorthand
.using(.push)
by providing a concrete expected type.Declaration
Swift
@MainActor final func using(_ action: NavigationControllerActions.PushAction<UINavigationController>) -> ContainerStepChainAssembly<UINavigationController, ViewController, Context>
-
Enables shorthand
.using(.pushAsRoot)
Declaration
Swift
@MainActor final func using(_ action: NavigationControllerActions.PushAsRootAction<UINavigationController>) -> ContainerStepChainAssembly<UINavigationController, ViewController, Context>
-
Enables shorthand
.using(.pushReplacingLast)
Declaration
Swift
@MainActor final func using(_ action: NavigationControllerActions.PushReplacingLastAction<UINavigationController>) -> ContainerStepChainAssembly<UINavigationController, ViewController, Context>
-
Enables shorthand
.using(.addTab)
by providing a concrete expected type.Declaration
Swift
@MainActor final func using(_ action: TabBarControllerActions.AddTabAction<UITabBarController>) -> ContainerStepChainAssembly<UITabBarController, ViewController, Context>
-
Enables shorthand
.using(.addTab)
by providing a concrete expected type.Declaration
Swift
@MainActor final func using(_ action: TabBarControllerActions.AddTabAction<UITabBarController>) -> ContainerStepChainAssembly<UITabBarController, ViewController, Context>
-
Enables shorthand
.using(.setAsPrimary)
by providing a concrete expected type.Declaration
Swift
@MainActor final func using(_ action: SplitViewControllerActions.SetAsMasterAction<UISplitViewController>) -> ContainerStepChainAssembly<UISplitViewController, ViewController, Context>
-
Enables shorthand
.using(.pushToDetails)
Declaration
Swift
@MainActor final func using(_ action: SplitViewControllerActions.PushToDetailsAction<UISplitViewController>) -> ContainerStepChainAssembly<UISplitViewController, ViewController, Context>
-
Enables shorthand
.using(.pushOnToDetails)
Declaration
Swift
@MainActor final func using(_ action: SplitViewControllerActions.PushOnToDetailsAction<UISplitViewController>) -> ContainerStepChainAssembly<UISplitViewController, ViewController, Context>
-
Enables shorthand
.using(.push)
by providing a concrete expected type.Declaration
Swift
@MainActor final func using(_ action: SplitViewControllerActions.SetAsMasterAction<UISplitViewController>) -> ContainerStepChainAssembly<UISplitViewController, ViewController, Context>
-
Enables shorthand
.using(.pushToDetails)
Declaration
Swift
@MainActor final func using(_ action: SplitViewControllerActions.PushToDetailsAction<UISplitViewController>) -> ContainerStepChainAssembly<UISplitViewController, ViewController, Context>
-
Enables shorthand
.using(.pushOnToDetails)
Declaration
Swift
@MainActor final func using(_ action: SplitViewControllerActions.PushOnToDetailsAction<UISplitViewController>) -> ContainerStepChainAssembly<UISplitViewController, ViewController, Context>
-
Connects previously provided
DestinationStep
instance with anAction
Declaration
Swift
@_disfavoredOverload @MainActor final func using(_ action: some Action) -> StepChainAssembly<ViewController, Context>
Parameters
action
Action
instance to be used with a step. -
Connects previously provided
DestinationStep
instance with anAction
Declaration
Swift
@_disfavoredOverload @MainActor final func using<A>(_ action: A) -> ContainerStepChainAssembly<A.ViewController, ViewController, Context> where A : ContainerAction
Parameters
action
ContainerAction
instance to be used with a step.
-
Constructor
Declaration
Swift
@MainActor convenience init(finder: F, factory: FC)
Parameters
finder
The
UIViewController
Finder
instance.factory
The
UIViewController
ContainerFactory
instance. -
Connects previously provided
DestinationStep
instance with anAction
Declaration
Swift
@_disfavoredOverload @MainActor final func using(_ action: some Action) -> StepChainAssembly<ViewController, Context>
Parameters
action
Action
instance to be used with a step. -
Connects previously provided
DestinationStep
instance with anAction
Declaration
Swift
@_disfavoredOverload @MainActor final func using<A>(_ action: A) -> ContainerStepChainAssembly<A.ViewController, ViewController, Context> where A : ContainerAction
Parameters
action
ContainerAction
instance to be used with a step.
-
Connects previously provided
ActionToStepIntegrator
withNilEntity
factory with a step where theUIViewController
should avoid type checks Example:UIViewController
instance was loaded as a part of the stack inside of the storyboard.Declaration
Swift
@MainActor final func from(_ step: ActionToStepIntegrator<some UIViewController, Context>) -> ActionConnectingAssembly<ViewController, Context>
Parameters
step
ActionToStepIntegrator
instance to be used. -
Connects previously provided
DestinationStep
withNilEntity
factory with a step where theUIViewController
should avoid type checks Example:UIViewController
instance was loaded as a part of the stack inside of the storyboard.Declaration
Swift
@MainActor final func from(_ step: DestinationStep<some UIViewController, Context>) -> LastStepInChainAssembly<ViewController, Context>
Parameters
step
DestinationStep
instance to be used.
-
Connects previously provided
ActionToStepIntegrator
withNilEntity
factory with a step where theUIViewController
should avoid type checks.Declaration
Swift
@MainActor final func from(_ step: ActionToStepIntegrator<some UIViewController, Context>) -> ActionConnectingAssembly<ViewController, Context>
Parameters
step
ActionToStepIntegrator
instance to be used. -
Connects previously provided
DestinationStep
withNilEntity
factory with a step where theUIViewController
should avoid type checksDeclaration
Swift
@MainActor final func from(_ step: DestinationStep<some UIViewController, Context>) -> LastStepInChainAssembly<ViewController, Context>
Parameters
step
DestinationStep
instance to be used.