I am using hyperlinks in SwiftUI which are highlighted, but I also want them to be underlined as well. Is that possible?
Text("This [link](https://google.com) goes to google")
How can I make the link part underlined?
I am using hyperlinks in SwiftUI which are highlighted, but I also want them to be underlined as well. Is that possible?
Text("This [link](https://google.com) goes to google")
How can I make the link part underlined?
Copyright © 2021 Jogjafile Inc.
You can search for link runs in the attributed string and based on their ranges modify the attributes of the main string:
Previewing the above example yields this result:
During my testing, using
.underlineColorhad no effect. I'm not sure why.