我有一个嵌入在
我需要将第一个
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
?
非常感谢。
presentingViewController
不是类型AV
? - ajrlewisAVC
模态呈现BVC
。那么为什么这个属性是NavigationController
类型而不是AVC
类型? - ajrlewis