Created
June 15, 2012 06:51
-
-
Save hustKiwi/2935077 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)webView:(UIWebView *)webView | |
shouldStartLoadWithRequest:(NSURLRequest *)request | |
navigationType:(UIWebViewNavigationType)navigationType { | |
NSURL * url = [request URL]; | |
if ([[url scheme] isEqualToString:@"crab"]) { | |
// 在这里做js调native的事情 | |
// .... | |
// 做完之后用如下方法调回js | |
[webView stringByEvaluatingJavaScriptFromString:@"window.command"]; | |
return NO; | |
} | |
return YES; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment