[英]How can I dismiss a UINavigationController presented modally?
I have the following structure: 我有以下结构:
UINavigationController(1) -> MainViewController ---PRESENT MODAL--->
UINavigationController(2) -> TutorialViewController ---PRESENT MODAL---> LoginViewController
---PRESENT MODAL---> SignupViewController
I want to dismiss the UINavigationController(2) from a user action on LoginViewController. 我想从LoginViewController上的用户操作中撤消UINavigationController(2)。
Any idea? 任何想法?
You should use delegation to dismiss the second view controller. 您应该使用委派来关闭第二个视图控制器。 So you would have the second nav controller be dismissed by the first nav controller, the one that presented it. 因此,您将让第二个导航控制器被显示该导航器的第一个导航控制器解雇。 This is the recommended way to dismiss modal views. 这是消除模态视图的推荐方法。
Here are the docs on delegation 这是关于授权的文档
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.