0

I'm trying to implement a SwiftUI alert with the following message:

enter image description here

The message contains a SF Symbol.

Here is my code:

struct ContentView: View {
    @State var showsAlert = false
    var body: some View {
        Text("Well done \(Image(systemName: "checkmark.circle"))")
            .padding(10)
        Button(action: {
            self.showsAlert.toggle()
        }) {
            Text("Show Alert")
        }
        .alert(isPresented: self.$showsAlert) {
            Alert(title: Text("Title"),
                  message: Text("Well done \(Image(systemName: "checkmark.circle"))"))
        }
    }
}

But the problem is the alert is not showing the SF Symbol.

Any of you know why this is not working or if there is a way around this to show the SF Symbol?

I'll really appreciate your help.

user2924482
  • 8,380
  • 23
  • 89
  • 173

0 Answers0