iOS XCode : Link webview open in browser


  1. implement webview delegate
  2. set webview delegate to class
  3. add to delegate :

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

Popular posts from this blog

PNScanner - Privacy Policy

Center Scrollview Swift iOS