tags:

views:

45

answers:

1

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 problem, 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

A: 

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.

Paul Lynch
thanks I'll try this a little later on, it seems that older versions of the the sdk did this by default
tigermain
seems I didnt actually need to do this in the end, I had this code already in place which was forcing the links to open in Safari, pretty much the other way round!!!
tigermain