potato
potato

Reputation: 49

Have iPhone webpage URL open in specific view in application

I have an application that acts like an internet browser for one webpage. If the webpage is in one view, can I have it act so when a specific URL is selected that it will open the URL in a different view?

Upvotes: 1

Views: 308

Answers (1)

justin
justin

Reputation: 868

Yes. In your webViewController, implement this

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

Check to see if it's the url you're interested in, then create and push a view that displays the web page.

Oh, and return NO to prevent the load from occurring in this view.

Upvotes: 6

Related Questions