SimpleContainerFactory

@MainActor
public protocol SimpleContainerFactory : ContainerFactory

A helper protocol to the ContainerFactory protocol. If a container does not need to deal with the children view controller creation, SimpleContainerFactory will handle integration of the children view controllers.

Associated types

  • Type of UIViewController that SimpleContainerFactory can build

    Declaration

    Swift

    associatedtype ViewController
  • Context to be passed into UIViewController

    Declaration

    Swift

    associatedtype Context

Methods to implement

  • Builds a UIViewController that will be integrated into the stack

    Parameters:

    • context: A Context instance provided to the Router.
    • viewControllers: UIViewController instances to be integrated into the container as children view controllers

      Throws

      The RoutingError if the build does not succeed.

    Declaration

    Swift

    @MainActor
    func build(with context: Context, integrating viewControllers: [UIViewController]) throws -> ViewController

    Return Value

    The built UIViewController container instance.

  • build(with:integrating:) Extension method

    Default implementation of the ContainerFactory‘s build method

    Declaration

    Swift

    @MainActor
    func build(with context: Context, integrating coordinator: ChildCoordinator) throws -> ViewController