In previous betas of Xcode 13 a purple runtime warning would appear when using the alert/confirmationDialog APIs incorrectly. For example, this:
struct ContentView: View {
var body: some View {
Text("Hi")
.alert(
"Alert",
isPresented: .constant(true),
presenting: Int?.none,
actions: { _ in
Button("Ok") { }
}
)
}
}Would show a warning:
🟣 Attempting to present an alert without any data. The
dataparameter must be non-nil whenisPresentedis true.
But now no warning appears and so it can be confusing why the alert/confirmationDialog is presented with invalid data.