<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/confirmationDialog(_:item:titleVisibility:actions:message:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE18confirmationDialog_4item15titleVisibility7actions7messageQrAA4TextV_AA7BindingVyqd_1_SgGAA0H0Oqd__qd_1_XEqd_0_qd_1_XEtAaBRd__AaBRd_0_r1_lF::OverloadGroup"
  },
  "title" : "confirmationDialog(_:item:titleVisibility:actions:message:)"
}
-->

# confirmationDialog(_:item:titleVisibility:actions:message:)

Presents a confirmation dialog with a message using data to produce the
dialog’s content and a text view for the message.

```
@export(implementation) nonisolated func confirmationDialog<A, M, T>(_ title: Text, item data: Binding<T?>, titleVisibility: Visibility = .automatic, @ContentBuilder actions: (T) -> A, @ContentBuilder message: (T) -> M) -> some View where A : View, M : View
```

## Parameters

`title`

the title of the dialog.

`data`

A binding to optional source of truth for the confirmation
dialog. The system presents the dialog when the binding’s value is
non-nil. When the user presses or taps the dialog’s default action
button, the system sets this value to `nil` and dismisses. The
system passes the contents to the modifier’s closures. You use this
data to populate the fields of a confirmation dialog that you create
that the system displays to the user.

`titleVisibility`

The visibility of the dialog’s title. The default
value is [`Visibility.automatic`](/documentation/SwiftUI/Visibility/automatic).

`actions`

A [`ContentBuilder`](/documentation/SwiftUI/ContentBuilder) returning the dialog’s actions given the
currently available data.

`message`

A [`ContentBuilder`](/documentation/SwiftUI/ContentBuilder) returning the message for the dialog given
the currently available data.

---

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)