Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[attributedlabel] Allow linkColor to be ignored when nil. #337
I have recently encountered a project where the links in attributed label have to be styled in different color. However, it seems that if it is a link, the color that is specified through
In the local copy of nimbus in that project, a change was made to ignore
NIAttributedLabel *labelView = [[NIAttributedLabel alloc] init]; [labelView setLinkColor:nil]; [labelView setText:@"Hello Nimbus!"]; [labelView addLink:[NSURL URLWithString:@"http://example.com/"] range:NSMakeRange(0, 5)]; [labelView setTextColor:[UIColor redColor] range:NSMakeRange(0, 5)]; [labelView addLink:[NSURL URLWithString:@"http://nimbuskit.info/"] range:NSMakeRange(6, 6)]; [labelView setTextColor:[UIColor brownColor] range:NSMakeRange(6, 6)];
I am not sure if it is useful to others, nor if there is another better way of doing this (a flag for global ignore of link styles perhaps?). Please kindly review and see if it is appropriate. Thanks!