Created
April 19, 2024 20:10
-
-
Save apatronl/5e4a196ee66a5efc2dfeeb03c7e5de00 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
struct ContentView: View { | |
@State private var showAlert: Bool = false | |
var body: some View { | |
Button("Show alert") { | |
showAlert = true | |
}.alert( | |
"Hello!", | |
isPresented: $showAlert, | |
actions: { | |
Button("Delete data", role: .destructive) {} | |
Button("Cancel", role: .cancel) {} | |
}, | |
message: { | |
Text("This is a message!") | |
} | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment