Assemblies
-
Builds a
DestinationStep
instance with the correct settings into a chain of steps.NB
Both
Finder
andFactory
instances should deal with the same type ofUIViewController
andContext
instances.Usage
See morelet productScreen = StepAssembly(finder: ProductViewControllerFinder(), factory: ProductViewControllerFactory()) .adding(LoginInterceptor()) .adding(ProductViewControllerContextTask()) .adding(ProductViewControllerPostTask(analyticsManager: AnalyticsManager.sharedInstance)) .using(.push) .from(.navigationController) .using(.present) .from(.current) .assemble()
Declaration
Swift
@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
andFactory
instances should deal with the same type ofUIViewController
andContext
instances.Usage
let productScreen = StepAssembler<ProductViewController, ProductContext>() .finder(.classWithContextFinder) .factory(.storyboardFactory(name: "TabBar", identifier: "ProductViewController")) .adding(ContextSettingTask()) .using(.push) .from(.navigationController) .using(.present) .from(.current) .assemble()
*Introduced by Savva Shuliatev *
See moreDeclaration
Swift
@MainActor public struct StepAssembler<VC, C> where VC : UIViewController
-
Builds a
DestinationStep
which can contain the conditions to select the steps to be taken by aRouter
.Usage
See morelet containerStep = SwitchAssembly<UINavigationController, ProductContext>() .addCase { (context: ProductContext) in // If this configuration is requested by a Universal Link (productURL != nil), skip this case otherwise. guard context.productURL != nil else { return nil } return ChainAssembly.from(NavigationControllerStep<UINavigationController, ProductContext>()) .using(.present) .from(.current) .assemble() } // If UINavigationController is visible on the screen - use it .addCase(from: ClassFinder<UINavigationController, ProductContext>(options: .currentVisibleOnly)) // Otherwise - create a UINavigationController and present modally .assemble(default: ChainAssembly.from(NavigationControllerStep<UINavigationController, ProductContext>()) .using(.present) .from(.current) .assemble())
Declaration
Swift
@MainActor public final class SwitchAssembly<ViewController, Context> where ViewController : UIViewController
-
Builds a chain of steps.
See moreDeclaration
Swift
@MainActor public enum ChainAssembly
-
Builds a
ContainerFactory
fulfilled with the childrenUIViewController
factories.let rootFactory = CompleteFactoryAssembly(factory: TabBarFactory()) .with(XibFactory<HomeViewController, Any?>, using: UITabBarController.add()) .with(XibFactory<AccountViewController, Any?>, using: UITabBarController.add()) .assemble()
NB: Order matters here
See moreDeclaration
Swift
@MainActor public final class CompleteFactoryAssembly<FC> where FC : ContainerFactory
-
Transformer to be applied to transform one type of context to another.
See moreDeclaration
Swift
@MainActor public protocol ContextTransformer