example code
import SwiftUI
struct ContentView: View {
@State var showAlert = false
var body: some View {
Button(action: {
showAlert = true
}) {
Text("OK")
}.alert(isPresented: $showAlert) {
Alert(
title: Text("test"),
message: Text("alert alert alert").foregroundColor(.red)
)
}
}
}