I'm trying to create a generalized function/class that builds embedded hyperlinks. I am using an NSAttributedString
with NSAttributedString.Key.link
attribute and assigning a URL to the specified range. I can even specify multiple links within the body of text, with specific styles for the text. However the only caveat that I am seeing is that the highlighted state of the links have a grey background color. Is there a way to get rid of this background color, and on top of that assign a specified highlight state color for the link?
I am open to other means of creating the text and links, but I feel like NSAttributedString
is the right means.
Again:
- the body of text should be able to handle any number of links
- each link can contain any number of words
- the highlighted state shouldn't have a background color of grey, and be able to accept a specified color for a highlight state
- the text should be able to wrap if needed