SwiftUI Docs
老年人备忘录Fast, readable references
弹出展示Presentation

confirmationDialogconfirmationDialog

从底部弹出一组操作选项,适合二次确认或更多操作菜单。Shows a bottom action menu for confirmations or additional options.

入门Beginner4 分钟4 min
更新于Updated Apr 22, 2026

操作确认Action Confirmation

confirmationDialog 适合提供多个相关操作,比 alert 更像动作菜单。confirmationDialog is better for multiple related actions and feels more like an action menu than an alert.

更多选项More Options
swift
1@State private var showingOptions = false
2
3Button("More Options") {
4 showingOptions = true
5}
6.confirmationDialog("Choose an action", isPresented: $showingOptions) {
7 Button("Archive") {}
8 Button("Cancel", role: .cancel) {}
9}