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

CKTextComponent linkTextAttributes? #105

Closed
vishnevskiy opened this issue Apr 13, 2015 · 4 comments
Closed

CKTextComponent linkTextAttributes? #105

vishnevskiy opened this issue Apr 13, 2015 · 4 comments
Assignees
Labels

Comments

@vishnevskiy
Copy link

Is it possible to change the color of the links?

Thank you.

@ocrickard
Copy link
Contributor

Yep! All you need to do is change the NSForegroundColorAttributeName value to your color on your attributed string.

@vishnevskiy
Copy link
Author

I tried that before opening this ticket. Maybe you can tell me what I am doing wrong. He is an example.

https://gist.github.com/vishnevskiy/de9f64d4f9a452956243#file-test-m-L38

It renders fine but still blue with underline.

https://www.dropbox.com/s/01t9q9b7kmw2hg0/Screenshot%202015-04-13%2013.43.19.png?dl=0

@ocrickard ocrickard reopened this Apr 13, 2015
@ocrickard
Copy link
Contributor

As pointed out by others, I need to document this api!

The styling issue is actually in TextKit itself. This and other reasons are why we use an entity attribute instead to signify links (on my phone so can't get a link right now but you can find it by searching). Use an entity along with component actions to add taps me entities like links.

@grp
Copy link
Contributor

grp commented Apr 14, 2015

I think the best way to describe it is that the "link" attribute and the styling of a link are completely separate. What's tappable is controlled by CKTextKitEntityAttributeName, but it's up to you to style the ranges with CKTextKitEntityAttributeName however you want the links to appear.

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

No branches or pull requests

3 participants