Created
August 27, 2020 15:46
-
-
Save BetterProgramming/ec800309f95a4c371728a7320c06c569 to your computer and use it in GitHub Desktop.
This file contains 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
//alert with the option to dismiss | |
.alert(isPresented:$showingAlert) { | |
Alert(title: Text("Are you sure you want to leave?"), | |
message: Text("We'll miss you!"), | |
primaryButton: .default(Text("Leave")) { | |
self.presentationMode.wrappedValue.dismiss() | |
}, | |
secondaryButton: .cancel()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment