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

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

Name Description
selectorItemModel The selector item model.

follow(linkItemModel:)

func follow(linkItemModel: LinkItemModel)

Follows a LinkItemModel to an alternative HAAPI flow.

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.

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

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.

Parameters

Name Description
url A URL

openURL(_:)

func openURL(_ url: URL)

Attempts to open the resource at the specified URL.

Parameters

Name Description
url A URL