Yes @robnotyou it worked. But that API for showing an alert was deprecated.
.alert(isPresented: $showingAlert) {
Alert(title: Text("Alert"), message: Text("Message"), dismissButton: .default(Text("OK")))
}
https://developer.apple.com/documentation/swiftui/view/alert(item:content:)