I'm implementing a link in a UITextView, which will push a view controller on the navigation controller.
I'm trying to use the following method:
directionTextLabel.text = [directionTextLabel.text stringByAppendingString:[[NSString alloc] initWithFormat:@" %@", siteURL]];
directionTextLabel.dataDetectorTypes = UIDataDetectorTypeLink;
Which makes my link clickable. And then in my application delegate, I have:
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
NSLog(@"URL detected.");
return 1;
}
However, when I click on the link, it opens a new page without calling my app delegate method. Any idea what's going wrong, or other way I could implement that?
Thank you.