“构建”界面构建器中的选项 [英] "Builds for" option in interface builder

查看:89
本文介绍了“构建”界面构建器中的选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

界面构建器的文件检查器中有一个Builds for选项。我发现它会影响XIB文件中部署元素的属性。但是我找不到这个设置的真正目的。

There is an option "Builds for" in the file inspector of interface builder. I found that it affects attributes of deployment element in the XIB file. But I cannot find what is the real purpose of this setting.

我有一个部署目标为iOS7的iOS应用程序。我在一个特定的XIB中的Builds for设置中选择了一个iOS 8.0及更高版本选项。然后我用iPhone 7.1在iPhone上启动应用程序。但是可以加载和使用此XIB定义的屏幕。此设置是否对运行应用程序有一些影响?

I have an iOS app with deployment target iOS7. I select an option "iOS 8.0 and Later" in the "Builds for" setting in one specific XIB. Then I launch the app on iPhone with iOS 7.1. but the screen defined by this XIB can be loaded and used. Does this setting have some impact on running application?

推荐答案

'builds for'选项定义XIB文件的iOS版本意思是。

The 'builds for' option defines for which iOS version the XIB file is meant for.

例如,我的XIB中可能有UIStackView,仅适用于iOS 9及更高版本。
https://developer.apple.com/library/ ios / documentation / UIKit / Reference / UIStackView_Class_Reference /

For example, I may have UIStackView in my XIB which, is only meant for iOS 9 and later. https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIStackView_Class_Reference/

在这种情况下,我肯定希望在'版本中将其标记为'iOS 9.0及更高版本'对于'section或者它会导致编译错误。

In this scenario I would definitely like to mark it as 'iOS 9.0 and Later' in the 'builds for' section or else it will result in compilation error.

在你的测试用例中,即使你为iOS 8.0标记了XIB,它仍然是与iOS 7.1兼容并加载没有任何问题。

In your test case, it could be the case that even though you marked the XIB for iOS 8.0, it's still compatible with iOS 7.1 and loads without any issues.

希望这会有所帮助。

亲切的问候,

Mukund

这篇关于“构建”界面构建器中的选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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