My code below seems to say no. I think one should be able to have more than one alert in a view.
struct ContentView : View {
@State private var showingAlert = false
@State private var showSavedAlert = false
var body: some View {
VStack {
Text("Hello Everybody!")
Button(action: {
self.showingAlert = true
}) {
Text("Save")
}
Button(action: {
self.showSavedAlert = true
}) {
Text("Another Save")
}
}
.alert(isPresented: $showingAlert) {
Alert(title: Text("Save File?"), message: Text("Do you want to save?"), primaryButton: .default(Text("Save")), secondaryButton: .cancel())
}
.alert(isPresented: $showSavedAlert) {
Alert(title: Text("Another Save File?"), message: Text("Do you really want to save?"), primaryButton: .default(Text("Save")), secondaryButton: .cancel())
}
}
}