问题描述
我有一个具有以下层次结构的 UINavigationController
:
tableViewController -> detailView1 -> detailView2。
从 detailView2
开始,我尝试使用 unwind seque 返回 tableViewController
。但什么也没发生。
TableViewController 中有 unwind 方法
@IBAction func unwindTest( _ seg: UIStoryboardSegue) {
}
detailView2 有一个按钮。这会触发 unwind segue。这完成了从按钮拖动到此 ViewController 中的出口
注意:
当我尝试用 UITableviewController
替换 UIViewController
时,unwind segue 起作用了。
解决方法
未设置 UITableviewController 的自定义类。设置后,展开转场即可正常工作。