Skip to content

Instantly share code, notes, and snippets.

@cgack
Created January 14, 2013 14:37
Show Gist options
  • Save cgack/4530483 to your computer and use it in GitHub Desktop.
Save cgack/4530483 to your computer and use it in GitHub Desktop.
hasSuffix in PhoneGap
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
if ((navigationType == UIWebViewNavigationTypeLinkClicked) && ([[url absoluteString] hasSuffix:@"?openExternal=1"] ))
{
[[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