Search This Blog

Thursday, August 20, 2015

What is the difference between a .xib file and a .storyboard?

Apple introduced the concept of "storyboarding" in iOS5 SDK to simplify and better manage screens in your app. You can still use the .xib way of development.

Pre-storyboard, each UIViewController had an associated .xib with it. Storyboard achieves two things:
  1. .storyboard is essentially one single file for all your screens in the app and it shows the flow of the screens. You can add segues/transitions between screens, this way. So, this minimizes the boilerplate code required to manage multiple screens.
  2. Minimizes the overall no. of files in an app.
You can avoid using Storyboard while creating a new project by leaving the "Use Storyboard" option unchecked.

  • Storyboarding replace the need for .xib files
  • 1 .storyboard file = 'n' no of .xib files 
  • A storyboard is like a canvas where you put all your .xib files. 

You could refer this tutorial to get started.

Storyboard supports > iOS 5

No comments:

Post a Comment