Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//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