Get a click event for link in UITextView
There is one link in my UITextView. When I click on it, safari browser opens up and the web page for that link gets opened. But, the functionality I want is, when user will click on that link in textView, one form with webView will get opened and that web page for that link will be viewed to th开发者_如何学运维e user inside the application. I am not getting how to do it. I mean, How to get that click event for that link on the UITextView?? Please help me for this. The thing I want is , get an event for click on the link in UITextView..
Thanks.
There is an answer on this question. Below is the code that allows for intercepting that click. Be sure to read the entire answer, however, because it has a few details you need to be mindful of. All credit goes to @Felz.
@interface MyApplication : UIApplication {
}
@end
@implementation MyApplication
-(BOOL)openURL:(NSURL *)url{
if ([self.delegate openURL:url])
return YES;
else
return [super openURL:url];
}
@end
精彩评论