简体   繁体   English

打开新的ViewController

[英]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.

相关问题 Swift 3 - 关闭当前的 ViewController 并打开新的 ViewController - Swift 3 - Close current ViewController and Open new ViewController 我想通过UITableViewRowButtonAction打开一个新的ViewController - I want to open a new ViewController through UITableViewRowButtonAction 从滚动视图打开图像到新的视图控制器 - open an image from a scrollview into a new viewcontroller 一定时间后自动打开新的ViewController - open new ViewController automatiocally after a certain time 从当前的视图控制器中打开一个新的ViewController - Open a new ViewController from a current view controller 在tableView Swift中选择textField时打开New ViewController - Open New ViewController when textField is selected in tableView Swift 在按钮上打开一个新的ViewController单击是否输入的文本与解析字符串匹配 - Open a new ViewController on Button Click if text entered matches Parse string 向下移动UIButton 10px并打开新的ViewController - Move UIButton 10px down and open new ViewController 当用户点击推送通知时,关闭当前ViewController并打开新ViewController的最佳方法是什么 - When user tap push notification, what is the best way to close current viewcontroller and open new viewcontroller 在另一个ViewController中切换到新的ViewController? - Switching to a new ViewController in a different ViewController?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM