I want to use attributed strings with NSLinkAttributeName
to create clickable links inside a UILabel
instance within my iOS 7 project, which is now finally possible without using external libraries.
NSURL *url = [NSURL URLWithString:@"http://www.google.com"];
NSDictionary *attr = [NSDictionary dictionaryWithObjectsAndKeys:
url, NSLinkAttributeName, nil];
Applying the attribute on a string displays the text as blue & underlined, but nothing happens on click/tap. User interaction is enabled for the label. Does anybody know how to do this? Thanks!