Reputation: 21
If I didn't use verbatim with Text
Ex:
Text("Reach out to us on [email protected] for any queries!")
.foregroundColor(Color.white)
.font(Font.custom("Poppins-Regular", size: getFontSize(value: 16)))
Output:
And, if I used verbatim with
Text(verbatim: "Reach out to us on [email protected] for any queries!")
Ex:
Text(verbatim: "Reach out to us on [email protected] for any queries!")
.foregroundColor(Color.white)
.font(Font.custom("Poppins-Regular", size: getFontSize(value: 16)))
Output:
Email clickable functionality not working if I used verbatim with Text()
I want to with email clickable.
Upvotes: 2
Views: 864
Reputation: 6023
SwiftUI easy solution
Text("[email protected]")
.accentColor(.black)
.multilineTextAlignment(.leading)
Upvotes: 1
Reputation: 31
Jatin's solution also works if you just want to display an email address in your desired color: Text(.init("[email protected]")).font(.callout).accentColor(Color.white)
Upvotes: 0
Reputation: 1874
Try the below code It will help you:
Text(.init("Reach out to us on [[email protected]]([email protected]) for any queries!"))
.accentColor(.red)
here in the () round bracket, you have to write the link and in [] square bracket the respective text you want to see, here you want to show the email so in both brackets I wrote the email id modify as you want.
Upvotes: 1