Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple link colors #13

Open
patrizcesar opened this issue Nov 1, 2017 · 2 comments
Open

Multiple link colors #13

patrizcesar opened this issue Nov 1, 2017 · 2 comments

Comments

@patrizcesar
Copy link

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.

@evermeer
Copy link
Owner

evermeer commented Nov 1, 2017

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.

@patrizcesar
Copy link
Author

I see. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants