如何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中的退出操作。