How to enable textview Hyperlink detector in iOS and open Safari

Standard

If it is in a UITextView, you just have to enable it:

- (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange

also you can open Safari programatically:

@interface MyApplication : UIApplication {

}

@end

@implementation MyApplication


-(BOOL)openURL:(NSURL *)url{
    if  ([self.delegate openURL:url])
         return YES;
    else
         return [super openURL:url];
}
@end

Leave a Reply

Your email address will not be published. Required fields are marked *