Swift2 展开序列与popViewControllerAnimated
我有一个连接到多个ViewController的mapview 我需要从另一个按钮(而不仅仅是后退按钮)实现“放松”,因此我使用:Swift2 展开序列与popViewControllerAnimated,swift2,unwind-segue,popviewcontrolleranimated,Swift2,Unwind Segue,Popviewcontrolleranimated,我有一个连接到多个ViewController的mapview 我需要从另一个按钮(而不仅仅是后退按钮)实现“放松”,因此我使用: self.navigationController?.popViewControllerAnimated(true) 我的问题是:在上述工作过程中,我是否应该尝试在代码中使用父视图控制器中的prepareForUnwind和canPerformUnwindSegueAction,并从viewController中按住ctrl键拖动以退出情节提要?如果是,原因是什么
self.navigationController?.popViewControllerAnimated(true)
我的问题是:在上述工作过程中,我是否应该尝试在代码中使用父视图控制器中的
prepareForUnwind
和canPerformUnwindSegueAction
,并从viewController中按住ctrl键拖动以退出情节提要?如果是,原因是什么?基本上,如果您只是缩小显示的UIViewController
或从导航堆栈中弹出UIViewController
,则不需要使用展开分段,尽管对您来说也是如此
但请考虑这样一种情况,即存在UINavigationControllers
a、B、C,然后是RootViewController
R
然后考虑一个条件
(Present) R -> A
(Push) AR -> XVController
(Push)XVController -> B
(Present)BR-> YVContoller
...and so on..
现在,如果您想返回到刚刚启动的项目RootViewController的YVController。无法将popToRootViewController
弹出到BUINavigationController的导航堆栈中。现在您要做的是..使用委派或更改窗口RootViewController,这不是一个好主意
因此,您需要使用unwind segue来克服此问题。。演示使用它的功能的示例。基本上,如果您只是缩小显示的UIViewController
或从导航堆栈中弹出UIViewController
,则不需要使用展开段,尽管它对您也有相同的作用
但请考虑这样一种情况,即存在UINavigationControllers
a、B、C,然后是RootViewController
R
然后考虑一个条件
(Present) R -> A
(Push) AR -> XVController
(Push)XVController -> B
(Present)BR-> YVContoller
...and so on..
现在,如果您想返回到刚刚启动的项目RootViewController的YVController。无法将popToRootViewController
弹出到BUINavigationController的导航堆栈中。现在您要做的是..使用委派或更改窗口RootViewController,这不是一个好主意
因此,您需要使用unwind segue来克服此问题。。演示使用它的能力的示例