【问题标题】:If I perform an unwind segue (show), how can the mother view controller get the child's view controller?如果我执行 unwind segue (show),母亲视图控制器如何获得孩子的视图控制器?
【发布时间】:2015-06-14 09:24:24
【问题描述】:

我想检查执行 unwind segue 的视图控制器的类型。

在我的母亲控制器中,这就是我所拥有的:

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
    if let theChildView = segue. //what??
}

我如何检查调用 unwind 的孩子是什么类/类型?

【问题讨论】:

    标签: ios swift model-view-controller segue


    【解决方案1】:

    试试这个

    if segue.sourceViewController is ChildUIViewController{
    
    }
    

    或者你可以转换它

     if let child = segue.sourceViewController as? ChildUIViewController{
    
       }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-02-13
      • 1970-01-01
      • 1970-01-01
      • 2014-07-17
      • 1970-01-01
      • 1970-01-01
      • 2016-12-31
      • 1970-01-01
      相关资源
      最近更新 更多