import SwiftUI
struct AlertExample: View {
@State private var isPresentingAlert: Bool = false
var body: some View {
Button {
isPresentingAlert = true
} label: {
Text("Show alert")
}
.alert("This is an important message!", isPresented: $isPresentingAlert) {
}
}
}