I have done the following to have different color for links in my NIAttributedLabel:
NSMutableDictionary *attributes = [NSMutableDictionary dictionary];
[attributes setValue:[UIColor colorWithRed:86.0/255.0 green:134.0/255.0 blue:172.0/255.0 alpha:1.0] forKey:NSForegroundColorAttributeName];
[attributes setValue:[UIColor colorWithRed:0.0 green:136/255.f blue:204/255.f alpha:1.0] forKey:NSForegroundColorAttributeName];
[self.commentsText_ setAttributesForLinks:attributes];
but I am not seeing two different colors in the links, instead I am just seeing one. What am I doing wrong here? Basically I have a link that I've added via addLink as follows:
[self.commentsText_ addLink:[NSURL URLWithString:url] range:usernameRange];
and I want this to have the redColor. How do I do so?
If you want different colors for different links, then you need to create separate attribute dictionaries, and call setAttributesForLinks: with the different dictionaries.