PROTOCOL
HaapiFlowViewControllerDelegate
public protocol HaapiFlowViewControllerDelegate: AnyObject where Self: UIViewController
The interface for an object that serves as a Haapi
flow view controller's delegate.
Use a Haapi
flow view controller delegate to transmit information to a HaapiFlowViewController
object.
Methods
submit(interactionActionModel:parameters:)
func submit(interactionActionModel: InteractionActionModel, parameters: [String: Any])
Submits an InteractionActionModel
with some parameters to move forward in the HAAPI flow.
- Parameters:
- interactionActionModel: The interaction action model.
- parameters: Parameters to be sent with the form action model.
Parameters
Name | Description |
---|---|
interactionActionModel | The interaction action model. |
parameters | Parameters to be sent with the form action model. |
select(selectorItemModel:)
func select(selectorItemModel: SelectorItemInteractionActionModel)
Selects a SelectorItemModel
to move forward in the HAAPI Flow.
- Parameters:
- selectorItemModel: The selector item model.
Parameters
Name | Description |
---|---|
selectorItemModel | The selector item model. |
follow(linkItemModel:)
func follow(linkItemModel: LinkItemModel)
Follows a LinkItemModel
to an alternative HAAPI flow.
- Parameters:
- linkItemModel: The link item model.
Parameters
Name | Description |
---|---|
linkItemModel | The link item model. |
handleUIProblem(_:)
func handleUIProblem(_ uiProblem: UIProblemModel)
Handles a UIProblem
to HaapiFlowViewController
object and might interrupt the Haapi flow.
- Parameter uiProblem: A problem model informs something unexpected happened.
Parameters
Name | Description |
---|---|
uiProblem | A problem model informs something unexpected happened. |
interruptHaapiFlowForError(_:title:message:)
func interruptHaapiFlowForError(_ error: Error, title: String?, message: String?)
Interrupts the Haapi flow for a given Error
with a title
and a message
to HaapiFlowViewController
object.
- Parameters:
- error: An error that leads to interrupting the Haapi flow.
- title: The title information for interrupting the Haapi flow.
- message: The message information for interrupting the Haapi flow.
Parameters
Name | Description |
---|---|
error | An error that leads to interrupting the Haapi flow. |
title | The title information for interrupting the Haapi flow. |
message | The message information for interrupting the Haapi flow. |
canOpenURL(_:)
func canOpenURL(_ url: URL) -> Bool
Returns a Boolean value that indicates whether an app is available to handle a URL scheme.
- Parameter url: A URL
- Returns: false if the device doesn’t have an installed app registered to handle the URL’s scheme, or if you haven’t declared the URL’s scheme in your Info.plist file; otherwise, true.
Parameters
Name | Description |
---|---|
url | A URL |
openURL(_:)
func openURL(_ url: URL)
Attempts to open the resource at the specified URL.
- Parameter url: A URL
Parameters
Name | Description |
---|---|
url | A URL |