Skip to content

Instantly share code, notes, and snippets.

@cgack
Created January 14, 2013 14:42
Show Gist options
  • Save cgack/4530512 to your computer and use it in GitHub Desktop.
Save cgack/4530512 to your computer and use it in GitHub Desktop.
fragment
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
NSURL *url = [request URL];
if ( ([url fragment] != NULL) && ([[url fragment] rangeOfString:@"openExternal=true"].location != NSNotFound) )
{
if ([[UIApplication sharedApplication] canOpenURL:url]) {
[[UIApplication sharedApplication] openURL:url];
return NO;
}
}
return YES;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment