AttributedTextView icon indicating copy to clipboard operation
AttributedTextView copied to clipboard

Multiple link colors

Open patrizcesar opened this issue 6 years ago • 2 comments

Is there a way to set link colors differently in a single attributer? This is the first (blue) link and this one is the second (green) link

Thanks.

patrizcesar avatar Nov 01 '17 03:11 patrizcesar

Unfortunately you can't do that. It's a limitation of the NSAttributedText. On one UITextField you can only set a .linkColor for the entire control.

But I do see that TTAttributedLabel does have support for it. It looks like they don't use the default link mechanism. See: https://stackoverflow.com/questions/16555425/coloring-links-with-multiple-various-colors-in-the-same-nsattributedstring

I will have a look later to see how they implemented that.

evermeer avatar Nov 01 '17 07:11 evermeer

I see. Thank you!

patrizcesar avatar Nov 01 '17 09:11 patrizcesar