gonzobrains
gonzobrains

Reputation: 8036

iOS UIWebView needs to launch specific URLs in separate browser

I created an iOS app that uses a UIWebView to display a mobile website. The mobile site shows a "back" button within the UIWebView for its web server serves, but some pages provide links that navigate to external websites.

I want to provide a "back" button on those pages to get back to the original web server, but if I can't do this then I would like to launch these external sites in the standard browser in such a way that the user can still navigate the original site in the UIWebView using the "back" button already being displayed by the mobile site.

As it stands, my app cannot navigate back to the mobile site once a user clicks one of these "external" links because those sites do not display a back button to get back to the mobile app. How can I resolve this?

Upvotes: 1

Views: 211

Answers (1)

kaar3k
kaar3k

Reputation: 994

Use the delegate webView:shouldStartLoadWithRequest:navigationType: and open the external URL's in the safari using [[UIApplication sharedApplication] openURL:[NSURL URLWithString: @"http:/wwww.extrenalurls.com"]]

Upvotes: 1

Related Questions