Created
May 25, 2020 13:33
-
-
Save archieedwards/0c1f6ddf910e1f320c1fbbd85f3c6d5b 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 showAlert = false | |
var body: some View { | |
Button(action: { | |
self.showAlert.toggle() | |
}, label: { | |
Text("SHOW ALERT") | |
}) | |
.alert(isPresented: self.$showAlert, content: { | |
Alert(title: Text("I'm an alert"), message: Text("An alert message"), dismissButton: .default(Text("Bye alert!"), action: { | |
/// insert action for when user dismisses alert | |
})) | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment