Contents

requestConfirmation(conditions:actionName:dialog:)

Displays a confirmation prompt that includes the specified text and action details.

Declaration

func requestConfirmation(conditions: ConfirmationConditions = [], actionName: ConfirmationActionName = .`continue`, dialog: IntentDialog) async throws

Parameters

  • conditions:

    The conditions to check before asking for confirmation.

  • actionName:

    The action associated with the request. The system puts the action name in the button that confirms the action.

  • dialog:

    The localized text you want the confirmation request to display or speak.

Discussion

Call this method when you want someone to confirm a particular choice. For example, call this method before someone performs an action that might be destructive or unsafe. The method displays a prompt that includes the provided information and asks the person to confirm or cancel the operation. The method returns normally if they confirm the operation, but throws an error if they cancel it.

See Also

Requesting confirmation