开发者

Have iPhone webpage URL open in specific view in application

开发者 https://www.devze.com 2022-12-18 03:47 出处:网络
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 i

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?


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.

0

精彩评论

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