故事板中的源和目标Viewcontroller

时间:2012-12-23 15:22:22

标签: objective-c xcode uiviewcontroller

如何检测实际View是否来自Storyboard中的源或目标ViewController?

1 个答案:

答案 0 :(得分:0)

如果我理解正确,您可以通过以下方式测试questionedView

    if( [questionedView isDescendantOfView:[storyboardSegue sourceViewController].view] )
    {
      // view is from sourceViewController
    }

    if( [questionedView isDescendantOfView:[storyboardSegue destinationViewController].view] )
    {
      // view is from destinationViewController
    }