4

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 :)

jcaso
  • 69
  • 1
  • 7
  • **This question already has an answer here**:http://stackoverflow.com/questions/9404471/when-to-use-storyboard-and-when-to-use-xibs – sedrakpc Feb 20 '14 at 13:40

2 Answers2

6

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.

danypata
  • 9,895
  • 1
  • 31
  • 44
  • Thank you! :) How do you use .xib and storyboard files together? I tried doing so and ran into various issues. – jcaso Nov 17 '13 at 01:24
  • Basically it's kind of the same thing, when I use storyboards I use `instantiateViewController...` and segues, when I'm using xib files I'm using `initWithNibName:(NSString *)nibName bundle:(NSBundle *)nibBundle` and push/pop/present methods. – danypata Nov 17 '13 at 01:27
  • Okay! I'm going to try it that way and create a storyboard file as well I hope this works! – jcaso Nov 17 '13 at 01:31
3

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.

Astri
  • 575
  • 4
  • 10