Search code examples
ios

Develop application using Storyboard or xib file


I am beginner level ios developer.I want to know which is best practice to develop application using Storyboard or xib file? Why ?

I think xib file is easy to work.Also If I use Storyboard,it will be tough to add dynamic views.


Solution

  • Storyboards are now Apple's recommendation. I have used storyboards to create the current app I'm working on and I love them. The ease of being able to see the entire flow of your app is fantastic, instead of having to open multiple xib files.

    There is nothing stopping you from creating dynamic views when using a storyboard, you can add a blank view controller and have it linked to a code file that will create the entire view on viewDidAppear or viewDidLoad.

    You can also use "storyboardID" to create a shortcut so you can jump from one screen to any other screen without having a segue, comes in very handy sometimes.

    Overall, there is a bit of a learning curve to it, but the benefits especially towards debugging the flow of the app far outweighs the learning curve, and using storyboards doesn't prevent you from doing anything else, as it can always be done in code later on as it would normally.

    Some links to help

    I have used this link to start of from scratch: http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/SecondiOSAppTutorial/Introduction/Introduction.html

    This one looks a like it builds a bigger app using them, might be good: http://www.raywenderlich.com/5138/beginning-storyboards-in-ios-5-part-1