CLASS

ViewControllerFactoryRegistry

Contents

public class ViewControllerFactoryRegistry

A registration utility class that allows the injection of custom ViewControllerFactory into the internal resolver behaviour.

Methods

init()

public init()

Creates a ViewControllerFactoryRegistry.

registerViewControllerFactory(modelType:factory:)

public func registerViewControllerFactory<T: UIModel, S: UIStyle, H: HaapiUIViewController>(
    modelType: T.Type,
    factory: @escaping HaapiUIViewControllerFactory<T, S, H>
) -> ViewControllerFactoryRegistry where H.AssociatedModel == T, H.AssociatedStyle == S

Sets a custom HaapiUIViewControllerFactory for a model type. The provided model type must conform to the frameworks UIModel based type hierachy.

Parameters

Name Description
modelType The concrete type of custom UI model or one of the framewworks model protocols.
factory A closure responsible for taking a model instance in and providing a UIViewController that conforms to HaapiUIViewController and is capable of handling the UI rendering and behaviour for thal model type.

registerViewControllerFactoryFormModel(factory:)

public func registerViewControllerFactoryFormModel(
    factory: @escaping (
        FormModel,
        FormViewControllerStyle,
        HaapiUIViewControllerStyle
    ) throws -> any HaapiUIViewController
) -> ViewControllerFactoryRegistry

Sets a custom HaapiUIViewControllerFactory for a model of type FormModel

Parameters

Name Description
factory A closure responsible for taking a model instance in and providing a UIViewController that conforms to HaapiUIViewController and is capable of handling the UI rendering and behaviour for thal model type.

registerViewControllerFactorySelectorModel(factory:)

public func registerViewControllerFactorySelectorModel(
    factory: @escaping (
        SelectorModel,
        SelectorViewControllerStyle,
        HaapiUIViewControllerStyle
    ) throws -> any HaapiUIViewController
) -> ViewControllerFactoryRegistry

Sets a custom HaapiUIViewControllerFactory for a model of type SelectorModel

Parameters

Name Description
factory A closure responsible for taking a model instance in and providing a UIViewController that conforms to HaapiUIViewController and is capable of handling the UI rendering and behaviour for thal model type.

registerViewControllerFactoryProblemModel(factory:)

public func registerViewControllerFactoryProblemModel(
    factory: @escaping (
        ProblemModel,
        ProblemViewControllerStyle,
        HaapiUIViewControllerStyle
    ) throws -> any HaapiUIViewController
) -> ViewControllerFactoryRegistry

Sets a custom HaapiUIViewControllerFactory for a model of type ProblemModel

Parameters

Name Description
factory A closure responsible for taking a model instance in and providing a UIViewController that conforms to HaapiUIViewController and is capable of handling the UI rendering and behaviour for thal model type.

registerViewControllerFactoryPollingModel(factory:)

public func registerViewControllerFactoryPollingModel(
    factory: @escaping (
        PollingModel,
        PollingViewControllerStyle,
        HaapiUIViewControllerStyle
    ) throws -> any HaapiUIViewController
) -> ViewControllerFactoryRegistry

Sets a custom HaapiUIViewControllerFactory for a model of type PollingModel

Parameters

Name Description
factory A closure responsible for taking a model instance in and providing a UIViewController that conforms to HaapiUIViewController and is capable of handling the UI rendering and behaviour for thal model type.

registerViewControllerFactoryWebAuthnOperationModel(factory:)

public func registerViewControllerFactoryWebAuthnOperationModel(
    factory: @escaping (
        any WebAuthnOperationModel,
        WebAuthnViewControllerStyle,
        HaapiUIViewControllerStyle
    ) throws -> any HaapiUIViewController
) -> ViewControllerFactoryRegistry

Sets a custom HaapiUIViewControllerFactory for a model of type WebAuthnOperationModel

Parameters

Name Description
factory A closure responsible for taking a model instance in and providing a UIViewController that conforms to HaapiUIViewController and is capable of handling the UI rendering and behaviour for thal model type.

registerViewControllerFactoryGenericModel(factory:)

public func registerViewControllerFactoryGenericModel(
    factory: @escaping (
        GenericModel,
        GenericViewControllerStyle,
        HaapiUIViewControllerStyle
    ) throws -> any HaapiUIViewController
) -> ViewControllerFactoryRegistry

Sets a custom HaapiUIViewControllerFactory for a model of type GenericModel

Parameters

Name Description
factory A closure responsible for taking a model instance in and providing a UIViewController that conforms to HaapiUIViewController and is capable of handling the UI rendering and behaviour for thal model type.