Links are not colorised when using setLink:range: #128

Frizlab opened this Issue Feb 15, 2013 · 3 comments


None yet

2 participants

Frizlab commented Feb 15, 2013


I tried migrated to the new way of adding links, that is directly to the attributed string instead of telling the label to add the links.
The links were indeed detected (I was able to tap on them), but they were not colorised.

I did a bit a searching and I think I found the root cause of the problem. As I understand, the colorisation is done in recomputeLinksInTextIfNeeded. In this method there is a test to check whether it is actually needed to recompute links or not. The test goes as follow: if (!_attributedText || (self.automaticallyAddLinksForType == 0 && _customLinks.count == 0)). When using setLink:range:, none of the tests becomes false, then the link computation is given up which result in links not being colorised.

Thanks for your wonderful library by the way, it saved my life :)
Sorry if I missed anything.


You're right, there's an issue here. Will try to fix that anytime soon!

Frizlab commented Mar 9, 2013

Any news?


Fixed by merge of #135 (see commit 362f9fa)

@AliSoftware AliSoftware closed this Oct 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment