Concept

confirmationDialog is used in SwiftUI to present a set of actions for the user to choose from.

It allows apps to:

show multiple choices
let the user select an action
present action-sheet style options

Core flow:

Button / State Change → ConfirmationDialog Appears → User Selects Action

What It Does

A confirmationDialog shows a list of possible actions above the current screen.

It is commonly used for:

choosing from multiple options
showing quick action menus
asking for final confirmation

It usually contains:

a title
several action buttons
an optional cancel action

Basic Structure

.confirmationDialog("Choose an action", isPresented: $showDialog) {
    Button("Save") { }
    Button("Delete", role: .destructive) { }
    Button("Cancel", role: .cancel) { }
}

Here:

"Choose an action" → title
isPresented → controls presentation
Button → selectable actions

Using State With ConfirmationDialog