<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntents",
  "identifier" : "/documentation/AppIntents/AppIntent/requestConfirmation(conditions:actionName:dialog:showDialogAsPrompt:content:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "App Intents",
      "SwiftUI",
      "AppIntents"
    ],
    "preciseIdentifier" : "s:10AppIntents0A6IntentP01_aB8_SwiftUIE19requestConfirmation10conditions10actionName6dialog18showDialogAsPrompt7contentyAA0G10ConditionsV_AA0g6ActionJ0VAA0cM0VSgSbqd__yXEtYaK0dE04ViewRd__lF"
  },
  "title" : "requestConfirmation(conditions:actionName:dialog:showDialogAsPrompt:content:)"
}
-->

# requestConfirmation(conditions:actionName:dialog:showDialogAsPrompt:content:)

Displays a confirmation prompt with an interactive snippet.

```
func requestConfirmation<Content>(conditions: ConfirmationConditions = [], actionName: ConfirmationActionName = .`continue`, dialog: IntentDialog? = nil, showDialogAsPrompt: Bool = true, @ViewBuilder content: () -> Content) async throws where Content : View
```

## Parameters

`conditions`

The conditions to check before asking for confirmation.

`actionName`

The name to use in the button that confirms the action.

`dialog`

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

`showDialogAsPrompt`

`true` to include the contents of the `dialog` parameter in
the confirmation interface. Specify `false` to omit the dialog from the interface.

`content`

The SwiftUI view to display in the confirmation interface.

## 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 with the provided snippet, and asks the person to confirm or
cancel the operation. The method returns normally if the person confirms the operation,
but throws an error if they cancel it.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)