使用情节提要在Xcode 6.1.1中解散Segue [英] Unwind Segue in Xcode 6.1.1 with storyboard

查看:40
本文介绍了使用情节提要在Xcode 6.1.1中解散Segue的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在阅读Xcode 6中出现的错误提示问题.我正在使用Xcode 6.1.1,并且使用了swift.

I have been reading that unwind segue's are bugged in Xcode 6. I am using Xcode 6.1.1 and I use swift.

我使用导航控制器上的返回"按钮.因此,我无法将cntrl拖动到退出图标.此外,我也不能从viewController图标拖动到退出图标.

I use the "Back" button that is put by the navigation controller. Thus I can't cntrl drag to the exit icon. Moreover I can't drag from viewController icon to exit icon either.

这是一个错误吗?否则,我会缺少一些有关如何使用展开式搜索的基本知识.如何从情节提要中设置放松的时间?

Is this a bug? Or else I am missing some fundamental knowledge about how to use unwind segue. How can I set unwind segues from the storyboard?

推荐答案

使其正常运行.如果要从NavigationController或TabBarController呈现(不确定TabBarController),则需要对导航控制器进行子类化,并向其中添加展开序列.在情节提要中,不要忘记更改导航控制器的类.我的视图层次结构是NavController-> TableController-> DetailController.将方法添加到自定义NavBar类后,将其添加到要返回的VC中.然后,您可以按ctrl拖动以退出.我认为这是一个错误,因为一旦将其连接起来,便能够删除该子类并返回到库存NavigationController,并且仍然有效.

Got it working. If you are presenting from a NavigationController or TabBarController(unsure about the TabBarController), you need to subclass the navigation controller and add the unwind segue to that. In storyboard don't forget to change the class of your navigation controller. My view hierarchy was NavController -> TableController -> DetailController. After adding method to custom NavBar class add it to the VC you want to RETURN to. You will then be able to ctrl-drag to exit. I consider this a bug, as once it is hooked up I was able to delete the subclass and return to stock NavigationController and it still worked.

这篇关于使用情节提要在Xcode 6.1.1中解散Segue的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆