简体   繁体   中英

Using Storyboard VS .xib (XCode 5)

This is more of a question than an issue with code.. I'm new to iOS developing and I am looking to submit an app I'm creating to the Apple Store. I have been debating whether to use .xib(nib) files or storyboard. I am currently using .xib files but considering changing it. Which one is generally best from your opinion? And will the app store accept apps made in storyboard? I've heard of it not being backwards compatible with earlier iPhone versions and want to play it as safe as possible. Thanks guys :)

So storyboards are available for iOS 5 and above, so if you want to submit an app compatible for versions prior iOS 5, you can't do it mainly because you have to set your target and that will generate lots of errors because of storyboards.

App store definitely won't reject your app because it's using storyboards, actually Apple guys recommend using storyboards.

Regarding the xib vs storyboards... I generally use storyboards and also xib files depending on the project. With storyboards you don't have to write the code for push/pop/present view controllers and from my opinion, storyboards are cleaner and they can present you the main flow of the app, making debug much easier.

Regarding the backwards compatible, this concept "backwards compatible" is not present on iOS :)). I don't know a new feature introduced into a new version of iOS that is backwards compatible.

Watch this: http://www.raywenderlich.com/51992/storyboards-vs-nibs-vs-code-the-great-debate . It has some good points for each approach. The resume is that you better using storyboards but there will be cases that you will have to use xib files for some complex views, in order to keep your code clean.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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