如果我执行 unwind segue (show),母视图控制器如何获得 child 的视图控制器?
If I perform an unwind segue (show), how can the mother view controller get the child's view controller?
我想检查执行展开转场的视图控制器的类型。
在我的母控制器中,这是我拥有的:
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if let theChildView = segue. //what??
}
我如何查看调用平仓的 class/type 是什么 child?
试试这个
if segue.sourceViewController is ChildUIViewController{
}
或者你可以转换它
if let child = segue.sourceViewController as? ChildUIViewController{
}
我想检查执行展开转场的视图控制器的类型。
在我的母控制器中,这是我拥有的:
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if let theChildView = segue. //what??
}
我如何查看调用平仓的 class/type 是什么 child?
试试这个
if segue.sourceViewController is ChildUIViewController{
}
或者你可以转换它
if let child = segue.sourceViewController as? ChildUIViewController{
}