在UINavigationController中展开UIStoryboardSegue子类

时间:2013-05-29 08:11:37

标签: iphone uinavigationcontroller uistoryboard uistoryboardsegue

我正试图解开UIStoryboardSegue子类。如果主窗口的rootViewController是一个UIViewController子类,那么一切都很好。

但是,如果它是UINavigationController子类,我的segue永远不会在展开时触发。

我已经创建了一个示例应用来演示这个,并把它放在Github上: https://github.com/simonmaddox/CustomUnwindSegue

2 个答案:

答案 0 :(得分:4)

在使用DTS请求后,Apple建议如下:

  

简短的回答是,当存在UINavigationController时,SMXViewController实际上并不是所呈现的SMXSecondViewController的父级。因此,它只有有限的参与放卷过程。

     

...

     

解决此实现细节的方法是使用您自己的UINavigationController子类。然后你可以覆盖-segueForUnwindingToViewController:fromViewController:identifier:来实现你自己的逻辑或者将消息转发给UINavigationController父类,如果它是你不感兴趣的unwind segue那么。

DTS_Response分支上也存在完整的解决方案: https://github.com/simonmaddox/CustomUnwindSegue/tree/DTS_Response

答案 1 :(得分:0)

Here是完整的示例,为您解释。