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,080
  • 9
  • 40
  • 69

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,842
  • 5
  • 23
  • 39