CompleteFactoryAssembly
public final class CompleteFactoryAssembly<FC> where FC : ContainerFactory
Builds a ContainerFactory
fulfilled with the children UIViewController
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
-
Constructor
Declaration
Swift
public init(factory: FC)
Parameters
factory
The
ContainerFactory
instance. -
Adds a
Factory
that is going to be used as a childDeclaration
Swift
public final func with<ChildFC: Factory, A: ContainerAction, T: ContextTransformer>(_ childFactory: ChildFC, using action: A, adapting transformer: T) -> CompleteFactoryChainAssembly<FC, ChildFC.ViewController, ChildFC.Context> where T.TargetContext == ChildFC.Context, T.SourceContext == FC.Context, A.ViewController == FC.ViewController
-
Adds a
ContainerFactory
that is going to be used as a childDeclaration
Swift
public final func with<ChildFC: ContainerFactory, A: ContainerAction, T: ContextTransformer>(_ childContainer: ChildFC, using action: A, adapting transformer: T) -> CompleteFactoryChainAssembly<FC, ChildFC.ViewController, ChildFC.Context> where T.TargetContext == ChildFC.Context, T.SourceContext == FC.Context, A.ViewController == FC.ViewController
Parameters
childContainer
The instance of
ContainerFactory
.action
The instance of
ContainerFactory
to be used to integrate the view controller produced by the factory. -
Adds a
Factory
as the last view controller in the stack.Declaration
Swift
public final func with<ChildFC, T>(_ childFactory: ChildFC, adapting transformer: T) -> CompleteFactoryChainAssembly<FC, ChildFC.ViewController, ChildFC.Context> where ChildFC : Factory, T : ContextTransformer, FC.Context == T.SourceContext, ChildFC.Context == T.TargetContext
Parameters
childFactory
The instance of
Factory
.transformer
The instance of
ContextTransformer
to use to adapt parentContainerFactory
Context
. -
Adds a
ContainerFactory
as the last view controller in the stack.Declaration
Swift
public final func with<ChildFC, T>(_ childContainer: ChildFC, adapting transformer: T) -> CompleteFactoryChainAssembly<FC, ChildFC.ViewController, ChildFC.Context> where ChildFC : ContainerFactory, T : ContextTransformer, FC.Context == T.SourceContext, ChildFC.Context == T.TargetContext
Parameters
childContainer
The instance of
ContainerFactory
.transformer
The instance of
ContextTransformer
to use to adapt parentContainerFactory
Context
. -
Adds a
Factory
that is going to be used as a childDeclaration
Swift
public final func with<ChildFC: Factory, A: ContainerAction>(_ childFactory: ChildFC, using action: A) -> CompleteFactoryChainAssembly<FC, ChildFC.ViewController, ChildFC.Context> where ChildFC.Context == FC.Context, A.ViewController == FC.ViewController
-
Adds a
ContainerFactory
that is going to be used as a childDeclaration
Swift
public final func with<ChildFC: ContainerFactory, A: ContainerAction>(_ childContainer: ChildFC, using action: A) -> CompleteFactoryChainAssembly<FC, ChildFC.ViewController, ChildFC.Context> where ChildFC.Context == FC.Context, A.ViewController == FC.ViewController
Parameters
childContainer
The instance of
ContainerFactory
.action
The instance of
ContainerFactory
to be used to integrate the view controller produced by the factory. -
Adds a
Factory
as the last view controller in the stack.Declaration
Swift
public final func with<ChildFC>(_ childFactory: ChildFC) -> CompleteFactoryChainAssembly<FC, ChildFC.ViewController, ChildFC.Context> where ChildFC : Factory, FC.Context == ChildFC.Context
Parameters
childFactory
The instance of
Factory
. -
Adds a
ContainerFactory
as the last view controller in the stack.Declaration
Swift
public final func with<ChildFC>(_ childContainer: ChildFC) -> CompleteFactoryChainAssembly<FC, ChildFC.ViewController, ChildFC.Context> where ChildFC : ContainerFactory, FC.Context == ChildFC.Context
Parameters
childContainer
The instance of
ContainerFactory
. -
Assembles all the children factories provided and returns a
ContainerFactory
instance.Declaration
Swift
public final func assemble() -> CompleteFactory<FC>
Return Value
The
CompleteFactory
with child factories provided.