【发布时间】:2018-11-09 20:40:53
【问题描述】:
我有一个嵌入在UINavigationController 中的UIViewController (AVC)。 AVC(以模态形式出现)转至另一个 UIViewController(BVC)。在BVC 内部,变量self.presentingViewController 的类型是可选的NavigationController,而不是我所期望的AVC。
我必须将第一个childViewControllers 转换为AVC,如下所示:
let pvc = self.presentingViewController
if let avc = pvc?.childViewControllers.first as? AVC {
// ...
}
为什么self.presentingViewController 不像我预期的那样,即AVC?
非常感谢。
【问题讨论】:
标签: ios swift uiviewcontroller uinavigationcontroller segue