0

So i have HTML that is loaded into web view and inside that html i have link like that

a href="http://www.google.com/" target="_blank">google</a>

So have do i make that link open inside a default browser not inside my web view .

Thanks!

gabrjan
  • 3,020
  • 9
  • 36
  • 67

1 Answers1

2
-(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request    navigationType:(UIWebViewNavigationType)navigationType {
       if (navigationType == UIWebViewNavigationTypeLinkClicked) {
          [[UIApplication sharedApplication] openURL:[request URL]];
          return NO;
       }
       return YES;
 }

I got it from here and here.

Community
  • 1
  • 1
esh
  • 2,802
  • 5
  • 21
  • 37