简体   繁体   English

如何在没有navigationController的情况下过渡到根视图控制器?

[英]How to transition to root view controller without navigationController?

I have an application that transitions from the main launchVC to a register or login VC and then from there transitions into the main application view controller. 我有一个从主launchVC过渡到注册或登录VC,然后从那里过渡到主应用程序视图控制器的应用程序。 Now I am not using the built in navigation that you can use with an iOS app instead I'm using my own buttons. 现在,我没有使用可与iOS应用程序一起使用的内置导航,而是使用了自己的按钮。 So my question is how do I "pop back" to the launchVC. 所以我的问题是如何“弹出” launchVC。 Image in application where you have logged in and when you tap "log out" all of the view controller get dismissed back to the launch view controller. 在您登录的应用程序中,当您点击“注销”时,所有视图控制器中的图像都将退回到启动视图控制器中。 Any help would be appreciated. 任何帮助,将不胜感激。 Thank you! 谢谢!

You can make your launch view controller a delegate, passing it to the view controller that contains the logout button. 您可以使启动视图控制器成为委托,然后将其传递给包含注销按钮的视图控制器。 Once the button is pressed, then that will notify the delegate (launch view controller) which can then dismiss all of the presented view controllers. 一旦按下按钮,它将通知委托人(启动视图控制器),然后可以关闭所有显示的视图控制器。

Here is a tutorial on how to configure such a pattern. 是有关如何配置这种模式的教程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM