简体   繁体   English

如何使用情节提要segue将UIViewController连接到UIView,而无需任何代码?

[英]How to connect UIViewController to UIView using storyboard segue, without any code?

I am searching about some audio tutorial over internet and I eventually found a demo/example from apple. 我正在通过互联网搜索一些音频教程,最终从苹果找到了一个演示/示例。 In this example I am wondering how they connect UIViewController to a UIView using storyboard segues. 在此示例中,我想知道它们如何使用情节提要脚本将UIViewController连接到UIView。

Download project from here. 从这里下载项目。

Below is storyboard connections 以下是情节提要连接

在此处输入图片说明

When we run app below is it's output 当我们在下面运行应用程序时,它的输出是

在此处输入图片说明

Can any one explain how to achieve this. 谁能解释一下如何实现这一目标。

They are using container views to include child controllers defined somewhere else. 他们正在使用容器视图来包含在其他地方定义的子控制器。

Its actually still a connection between 2 controllers. 它实际上仍然是2个控制器之间的连接。 There is no independent view. 没有独立的观点。

To create a parent-child container relationship at design time, add a container view object to your storyboard scene, as shown in Figure 5-3. 要在设计时创建父子容器关系,请将一个容器视图对象添加到情节提要场景中,如图5-3所示。 A container view object is a placeholder object that represents the contents of a child view controller. 容器视图对象是一个占位符对象,代表子视图控制器的内容。 Use that view to size and position the child's root view in relation to the other views in the container... 使用该视图可以将子级根视图的大小和位置相对于容器中的其他视图...

See Implementing a Container View Controller in the Apple docs, chapter Configuring a Container in Interface Builder. 请参阅Apple文档中的“ 实现容器视图控制器 ”一章,在Interface Builder中配置容器。

Here container view is using. 这里正在使用容器视图。 Container view controllers are a way to combine the content from multiple view controllers into a single user interface. 容器视图控制器是一种将来自多个视图控制器的内容组合到单个用户界面中的方法。 Container view controllers are most often used to facilitate navigation and to create new user interface types based on existing content. 容器视图控制器最常用于促进导航并基于现有内容创建新的用户界面类型。 please view this link for detail 请查看此链接以获取详细信息

暂无
暂无

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

相关问题 如何在不使用 Storyboard segue 的情况下将项目从单独的 UIViewController 添加到 UICollectionViewController? - How to add item to a UICollectionViewController from a separate UIViewController without using Storyboard segue? 如何使用情节提要选择到UIViewController的几种子类型之一? - How to segue to one of several subtypes of UIViewController with a storyboard? 如何以编程方式从UINavigationController(storyboard)到UIViewController - How to segue from UINavigationController (storyboard) to UIViewController programmatically 使用情节提要板在UIViewController中初始化自定义UIView - Initialization of a custom UIView in a UIViewController using a storyboard 在 UIViewController Storyboard 中访问 UIView - access UIView In UIViewController Storyboard 如何在不使用Segue的情况下在单独的UIViewController中选择实例变量 - How to Select an Instance Variable in a Separate UIViewController Without Using a Segue 如何在没有任何延迟的情况下将UIView作为子视图添加到Storyboard的视图? - How to add an UIView as a subview to Storyboard's view without any delay? 在不使用代码的情况下将xib UIView添加到storyboard视图控制器 - add xib UIView to storyboard view controller without using code 如何在不使用Swift中的Storyboard的情况下以编程方式加载UIViewController - How to load a UIViewController programmatically without using Storyboard in Swift 从UIView导航到没有Storyboard和导航控制器的UIViewController - Navigate from UIView to UIViewController without storyboard and navigation controller
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM