Last active
May 25, 2020 14:14
-
-
Save archieedwards/9416abc9fee62160dac6e084145c7b8d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
@State var showAlertOne = false | |
@State var showAlertTwo = false | |
var body: some View { | |
VStack{ | |
/// button 1 | |
Button(action: { | |
self.showAlertOne.toggle() | |
}, label: { | |
Text("SHOW ALERT 1") | |
}) | |
.alert(isPresented: self.$showAlertOne, content: { | |
Alert(title: Text("I'm an alert")) | |
}) | |
/// button 2 | |
Button(action: { | |
self.showAlertTwo.toggle() | |
}, label: { | |
Text("SHOW ALERT 2") | |
}) | |
.alert(isPresented: self.$showAlertTwo, content: { | |
Alert(title: Text("I'm another alert")) | |
}) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment