CLASS
ViewControllerFactoryRegistry
Contents
- Methods
init()
registerViewControllerFactory(modelType:factory:)
registerViewControllerFactoryFormModel(factory:)
registerViewControllerFactorySelectorModel(factory:)
registerViewControllerFactoryProblemModel(factory:)
registerViewControllerFactoryPollingModel(factory:)
registerViewControllerFactoryWebAuthnOperationModel(factory:)
registerViewControllerFactoryGenericModel(factory:)
public class ViewControllerFactoryRegistry
A registration utility class that allows the injection of custom ViewControllerFactory
into the internal resolver behaviour.
- Experiment: This is an experimental API. It may be changed or removed in the future.
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:
- 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 toHaapiUIViewController
and is capable of handling the UI rendering and behaviour for thal model type.
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:
- factory: A closure responsible for taking a model instance in and providing a
UIViewController
that conforms toHaapiUIViewController
and is capable of handling the UI rendering and behaviour for thal model type.
- factory: A closure responsible for taking a model instance in and providing a
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:
- factory: A closure responsible for taking a model instance in and providing a
UIViewController
that conforms toHaapiUIViewController
and is capable of handling the UI rendering and behaviour for thal model type.
- factory: A closure responsible for taking a model instance in and providing a
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:
- factory: A closure responsible for taking a model instance in and providing a
UIViewController
that conforms toHaapiUIViewController
and is capable of handling the UI rendering and behaviour for thal model type.
- factory: A closure responsible for taking a model instance in and providing a
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:
- factory: A closure responsible for taking a model instance in and providing a
UIViewController
that conforms toHaapiUIViewController
and is capable of handling the UI rendering and behaviour for thal model type.
- factory: A closure responsible for taking a model instance in and providing a
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:
- factory: A closure responsible for taking a model instance in and providing a
UIViewController
that conforms toHaapiUIViewController
and is capable of handling the UI rendering and behaviour for thal model type.
- factory: A closure responsible for taking a model instance in and providing a
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:
- factory: A closure responsible for taking a model instance in and providing a
UIViewController
that conforms toHaapiUIViewController
and is capable of handling the UI rendering and behaviour for thal model type.
- factory: A closure responsible for taking a model instance in and providing a
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. |