简体   繁体   English

使用Interface Builder和故事板构建控制器之间的关系

[英]Using Interface Builder and storyboards to build relationships between controllers

Is there a way to use Interface Builder on a storyboard to establish relationships between controllers. 有没有办法在故事板上使用Interface Builder来建立控制器之间的关系。 eg similar to the way UITabBarController allows you to click-drag connections to other UIViewControllers in the storyboard to build up the viewControllers relationship? 例如,类似于UITabBarController允许您单击拖动连接到故事板中的其他UIViewControllers以建立viewControllers关系的方式?

ie when you click-drag from UITabBarController to another UIViewController a popup gives you the option to choose "Relationships - viewControllers". 即,当您从UITabBarController单击拖动到另一个UIViewController时,弹出窗口会为您提供选择“Relationships - viewControllers”的选项。 It then draws and maintains the line between the controllers on the storyboard. 然后,它绘制并维护故事板上控制器之间的线。 I want to be able to do the same thing for my own custom controllers. 我希望能够为我自己的自定义控制器做同样的事情。

I've tried, however it's looking bleak: 我试过了,但它看起来很暗淡:

How to create custom view controller container using storyboard in iOS 5 如何在iOS 5中使用故事板创建自定义视图控制器容器

is a start (see the source code posted in the comments) but it's a work around - you don't get the relationship segues, however you do get Custom UIViewController containment. 是一个开始(参见评论中发布的源代码),但它是一个解决方法 - 你没有得到关系segues,但你得到自定义UIViewController遏制。

I just thought it'd be prettier... Maybe iOS 8 will include this 我只是觉得它更漂亮......也许iOS 8会包含这个

所有证据似乎都表明这是不可能做到的,至少在最多4个XCode和最多5个iOS版本的版本中,如果我发现这些变化,将会更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM