0
当我按下表格视图单元格中的按钮时,我正试图回到先前的视图控制器。要做到这一点我的理解是我应该做的线沿线的东西:如何从Swift 3中的UITableViewCell引用当前的UINavigationController?
navigationController.popViewController(animated: true)
但是我发现它非常难以找到一种方法,从这个的UITableViewCell引用当前的UINavigationController。我试过这样的东西:
let navigationController = self.window?.rootViewController?.navigationController
总是返回nil。
请帮我找到一种方法来从Swift 3中的UITableViewCell引用UINavigationController!
'self.navigationController'应该可以工作 – NSDmitry
UITableViewCell没有这个变量不幸的是 – Legatro
我有一个引用的viewcontroller并且使用了你的代码 - 它的工作原理! Cheers @NSDmitry,非常感谢 – Legatro