---
title: "confirmationDialog(_:item:titleVisibility:actions:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/confirmationdialog(_:item:titlevisibility:actions:)"
---

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

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

## Declaration

```swift
nonisolated func confirmationDialog<A, T>(_ title: Text, item data: Binding<T?>, titleVisibility: Visibility = .automatic, @ContentBuilder actions: (T) -> A) -> some View where A : 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 doc://com.apple.SwiftUI/documentation/SwiftUI/Visibility/automatic.
- `actions`: A doc://com.apple.SwiftUI/documentation/SwiftUI/ContentBuilder returning the dialog’s actions given the currently available data.

## See Also

### Confirmation dialogs

- [confirmationDialog(_:isPresented:titleVisibility:actions:)](swiftui/view/confirmationdialog(_:ispresented:titlevisibility:actions:).md)
- [confirmationDialog(_:isPresented:titleVisibility:presenting:actions:)](swiftui/view/confirmationdialog(_:ispresented:titlevisibility:presenting:actions:).md)
- [dismissalConfirmationDialog(_:shouldPresent:actions:)](swiftui/view/dismissalconfirmationdialog(_:shouldpresent:actions:).md)
