当前位置: 动力学知识库 > 问答 > 编程问答 >

ios - Switch to next view with UIWebView

问题描述:

When you use the Facebook App and go to the Terms and Conditions view, there is a WebView. When you choose an option in the WebView you'll go to a new view.

Now I wanna make a login system with PHP. When the user login is succeded he'll go to an webpage. How can I set for example: When the UIWebView is on www.myserver.com/ok that the new view in my app will show?

网友答案:

Set your UIWebView with delegate and check :-

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
   NSLog(@"Loading: %@", [request URL]); //if url matches www.myserver.com/ok open your view
   return YES;
}

Hope it helps you..

分享给朋友:
您可能感兴趣的文章:
随机阅读: