我有一个与几个viewControllers连接的地图。
我需要实现从另一个按钮(而不是仅仅是后退按钮)中的“解除”,所以我使用了:
self.navigationController?.popViewControllerAnimated(true)我的问题是:在上面的工作中,我是否应该在父视图控制器+ctrl-从prepareForUnwind拖动到Storyboard中退出时,尝试使用prepareForUnwind和canPerformUnwindSegueAction在代码中实现展开?如果是,为什么?
发布于 2016-02-10 15:52:09
基本上,如果您只是一个显示的dimissing,或者是从导航堆栈中弹出一个UIViewController,那么您就不需要使用解卷,尽管它对您也有同样的作用。
但是想想有UINavigationControllers A,B,C,然后是A RootViewController R的例子
那就想想一个条件
(Present) R -> A
(Push) AR -> XVController
(Push)XVController -> B
(Present)BR-> YVContoller
...and so on..现在,如果您想回到YVController到您刚刚启动的项目RootViewController,up.There是不可能的,因为popToRootViewController会弹到B UINavigationController.Now的导航堆栈,您do..Either使用的是委托或更改窗口RootViewController,这不是一个好主意。
所以你需要用放松的方法来克服这一问题。一个示例项目来演示使用它的能力。
https://stackoverflow.com/questions/35300192
复制相似问题