SwiftUI: Button role: cancel doesn't show ("IOSurfaceClientSetSurfaceNotify failed")
I made the following confirmation dialog:
struct ContentView: View {
@State var isConfirmShown = false
var body: some View {
VStack {
Button("Display Confirm") {
isConfirmShown = true
}
.confirmationDialog(
Text("Are you sure?"),
isPresented: $isConfirmShown,
titleVisibility: .visible
) {
Button("Yes", role: .destructive) {}
Button("No", role: .cancel) {}
} message: {
Text("Some message, ...")
}
}
}
}
The button with role: .cancel doesn't show up. On the console a message "IOSurfaceClientSetSurfaceNotify failed e00002c7" is shown.
If I remove the role: .cancel-argument, the button is visible.
What goes wrong here? How can it become fixed?
