StoryboardFactory

public struct StoryboardFactory<VC, C> : Factory where VC : UIViewController

The Factory that creates a UIViewController from a storyboard.

Associated types

  • Declaration

    Swift

    public typealias ViewController = VC
  • Declaration

    Swift

    public typealias Context = C

Properties

  • The name of a storyboard file

    Declaration

    Swift

    public let name: String
  • The Bundle instance

    Declaration

    Swift

    public let bundle: Bundle?
  • The UIViewController identifier in the storyboard. If it is not set, the Factory will try to create the storyboards initial UIViewController

    Declaration

    Swift

    public let identifier: String?
  • The additional configuration block

    Declaration

    Swift

    public let configuration: ((VC) -> Void)?

Methods

  • Constructor

    Declaration

    Swift

    public init(name: String, bundle: Bundle? = nil, identifier: String? = nil, configuration: ((VC) -> Void)? = nil)

    Parameters

    storyboardName

    The name of a storyboard file

    bundle

    The Bundle instance if needed

    identifier

    The UIViewController identifier in the storyboard. If it is not set, the Factory will try to create the storyboards initial UIViewController

    configuration

    A block of code that will be used for the extended configuration of the created UIViewController. Can be used for a quick configuration instead of ContextTask.

  • Declaration

    Swift

    public func build(with context: C) throws -> VC