Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Builds for" option in interface builder

Tags:

xcode

ios

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.

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?

like image 300
Merlin Avatar asked Oct 16 '14 08:10

Merlin


1 Answers

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

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/

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.

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.

Hope this helps.

Kind regards,

Mukund

like image 121
Mukund Agarwal Avatar answered Sep 20 '22 06:09

Mukund Agarwal