开发者

How do I prevent breakout of a UIWebView

开发者 https://www.devze.com 2022-12-31 18:08 出处:网络
I have an app which is native iphone code but the client would like me to use a UIWebView to integrate the ecommerce components of their website.

I have an app which is native iphone code but the client would like me to use a UIWebView to integrate the ecommerce components of their website.

This isnt a p开发者_如何学Croblem, however I am yet to work out how I can prevent the app being closed and the user being redirected to Safari when any links are pressed within the UIWebView

Thanks


Implement:

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType

and check for UIWebViewNavigationTypeLinkClicked. You should probably also check various other possible values of navigationType.

0

精彩评论

暂无评论...
验证码 换一张
取 消