如何unwindForSegue:对viewController:工作?

在我的简单的应用程序中,我创build了一些基本的赛格控制器:

黄色控制器 – > BlueController – > GreenController – > OrangeController 。 他们每个人都有自己的习惯课。

OrangeController,我创build了unwindSegue到我的YellowController。 没关系。

在每堂课中我都提到:

override func unwindForSegue(unwindSegue: UIStoryboardSegue, towardsViewController subsequentVC: UIViewController) { print(unwindSegue) print(subsequentVC) } 

但是根本不叫。 为什么? 我应该准备什么样的testing来testing这个function?

同样是:

 func allowedChildViewControllersForUnwindingFromSource(source: UIStoryboardUnwindSegueSource) -> [UIViewController] func childViewControllerContainingSegueSource(source: UIStoryboardUnwindSegueSource) -> UIViewController? 

IBAction returnType实现该方法

 -(IBAction) unwindForSegue:(nonnull UIStoryboardSegue *)unwindSegue towardsViewController:(nonnull UIViewController *)subsequentVC 

Storyboard ,将控件(负责后退操作)链接到viewcontroller中的退出操作。 在这里输入图像说明

在这里输入图像说明