What are the benefits of using Storyboards instead of xib files in iOS programming?

Steve picture Steve · Jan 31, 2012 · Viewed 37.2k times · Source

What are the main differences between using Storyboards and xib files.

Specifically, what are the advantages or disadvantages of using a Storyboard?

Unfortunately, despite doing quite a bit of research, all I've been able to find on Storyboards are simple tutorials that show you how to set up a Storyboard, instead of concrete information explaining what they are.

Answer

LJ Wilson picture LJ Wilson · Jan 31, 2012

A Storyboard is:

  • A container for all your Scenes (View Controllers, Nav Controllers, TabBar Controllers, etc)
  • A manager of connections and transitions between these scenes (these are called Segues)
  • A nice way to manage how different controllers talk to each other
  • Storyboards give you a complete look at the flow of your application that you can never get from individual nib files floating around.
  • A reducer of all the "clutter" that happens when you have several controllers each with it's own nib file.

I have been using Storyboards for awhile now and the ONLY downside is that you can't target iOS 4 or below. Storyboards only work on devices running iOS 5 or better. Other than that, the benefits are many and the downsides are non-existent IMO.

The best tutorial I have seen is Ray Wenderlich's

Also, if you are a member of the Apple Developer program, check out last years WWDC session on Storyboards (iTunesU), it is awesome.

Another great one (also on iTunesU) is the latest Stanford iOS Application Programming course.