How to make CustomLink touchable in OHAttributedLabel
ios, uilabel
Solution
The required code in this case was simply:
[myLabel setDelegate:self];
And in context for those interested is:
descriptionLabel.attributedText = [NSMutableAttributedString attributedStringWithString:@"foo"];
[myLabel addCustomLink:[NSURL URLWithString:urlString] inRange:NSMakeRange(myLocation, myLength)];
[myLabel setDelegate:self];
Many thanks!
Problem
I am successfully adding links to a `UILabel` via `OHAttributeLabel` and `-(void)addCustomLink:(NSURL*)linkUrl inRange:(NSRange)range;` In other words, the correct range is underlined and looks like a link. However, I cannot click/touch on the link. Is there anything else that must be done that the `addCustomLink` method on the range of text? FWIW, I am not using Interface Builder even though much of the `OHAttributedLabel` code makes references to `IBOutlet`.