Guest User

Untitled

a guest
May 24th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. - (BOOL) webView:(UIWebView *)webView shouldStartLoadWithRequest: (NSURLRequest *)request navigationType: (UIWebViewNavigationType)navigationType {
  2. if (navigationType == UIWebViewNavigationTypeLinkClicked) {
  3. NSURL *url = [request URL];
  4. NSString *string = [url query];
  5.  
  6. if ([string rangeOfString: @"openInSafari=true"].location != NSNotFound){
  7. [[UIApplication sharedApplication] openURL: url];
  8. NSLog(@"Open in Safari");
  9. return NO;
  10. }
  11. }
  12. NSLog(@"Open in WebView");
  13. return YES;
  14.  
  15. }
Add Comment
Please, Sign In to add comment