[英]Open new ViewController
I writing and IOS app which connects with Google to identify the new user (registrationviewcontroller). 我编写了IOS应用程序,该应用程序与Google连接以识别新用户(registrationviewcontroller)。 So, the app open a web navigator to complete the identification process. 因此,该应用程序将打开一个Web导航器以完成识别过程。 When the identification process finish and return to the app thanks to my own URL scheme I would like to open a new View instead of registrationviewcontroller one. 由于我自己的URL方案,当识别过程完成并返回到应用程序时,我想打开一个新的View而不是registrationviewcontroller。
Firstly, Where is the best places to call the new viewcontroller? 首先,哪里是调用新ViewController的最佳位置? In the method applicationDidBecomeActive of the APPdelegate? 在APPdelegate的方法applicationDidBecomeActive中? or in the load method from the Registration ViewController? 或从注册ViewController的加载方法中?
Secondly, How can I lunch the new ViewController? 其次,如何为新的ViewController吃午餐?
Thanks in advance 提前致谢
If I understand you right, the app gets opened via a custom URL scheme. 如果我理解正确,该应用程序将通过自定义URL方案打开。 So 所以
-(BOOL) application:(UIApplication *)application handleOpenURL:(NSURL *)url {
will be called when your app reopens and you can easily present a view controller there, eg.: 应用重新打开时将调用,您可以在其中轻松显示视图控制器,例如:
SampleViewController *viewController=[[SampleViewController alloc] init];
[self presentModalViewController:navController animated:YES];
BTW: I'd recommend you to show the registrationViewController modally, if you don't already, this way you could simply dismiss it in handleOpenURL an would not need the code in the listing above. 顺便说一句:我建议您以模态方式显示registrationViewController,如果您还没有的话,这样您就可以在handleOpenURL中将其关闭,而无需上面清单中的代码。 eg: 例如:
[SampleSuperViewController dismissModalViewControllerAnimated:YES];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.