8

The following code

struct ContentView: View {
    var body: some View {
        Text("Hello, World!")
            .padding()
    }
}

Produces this
Hello, World

But the following code

struct ContentView: View {
    var body: some View {
        Text("hello@gmail.com")
            .padding()
    }
}

Produces this
Email

How can I make "hello@gmail.com" appear formatted like "Hello, World!" (no underline, no blue tint, remove link on click)?

Patrick
  • 2,035
  • 17
  • 27

1 Answers1

21

You can use the verbatim: form of Text, which will skip the parsing step:

struct ContentView: View {
    var body: some View {
        Text(verbatim: "hello@gmail.com")
            .padding()
    }
}
jnpdx
  • 45,847
  • 6
  • 64
  • 94