StepAssembly
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(UINavigationController.push())
.from(NavigationControllerStep())
.using(GeneralAction.presentModally())
.from(GeneralStep.current())
.assemble()
-
Connects previously provided
DestinationStep
instance with anAction
Declaration
Swift
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
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
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
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
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
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
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
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
final func from(_ step: DestinationStep<some UIViewController, Context>) -> LastStepInChainAssembly<ViewController, Context>
Parameters
step
DestinationStep
instance to be used.