2
struct ConfirmationDialog: View {
    @State private var showingOptions = false
    @State private var showingAlert = false

    var body: some View {
        VStack {
            Button("Show Options") {
                showingOptions = true
            }
            .alert("Alert Title", isPresented: $showingAlert, actions: {
                Button {
                    // Do nothing
                } label: {
                    Text("Okay")
                }
            }, message: {
                Text("Alert Message")
            })
            .confirmationDialog("Select option", isPresented: $showingOptions, titleVisibility: .visible) {
                Button("Show Alert") {
                    self.showingAlert = true
                }
            }
        }
    }
}

Alert isn't presenting when I use confirmationDialog and alert in a single View.

I'm getting a console log when confirmationDialog is presented for first time.

Attempting to present an alert while a confirmation dialog is already presented. This is not supported.

I'm using XCode 13 and iOS 15 simulator

Is it a bug in XCode 13?

0 Answers0