Consider Multiple Storyboards?

storyboard-example

*photo credit from http://spin.atomicobject.com/*

Why

For a simple project, it is ok to use one storyboard(with 5-10 view controllers) but imagine the project is getting bigger and there are 3-4 developers working on the same project and there are 10-20 view controllers.. your storyboard will turn into monster! From one storyboard splitting into multiple storyboards can be helpful and you can (try to) avoid conflicts in storyboards happen in between programmers when commit to the your project repository. By splitting them up, you have a better visibility between view controllers thus faster understanding for programmers that just jump into the project as well.

  1. Easier to organize your app layout if you have different layout for iPad (Grid layout) and iPhone (List layout). You just need to direct them to iPad or iPhone layout and you can still merge it back for the same layout.
  2. Avoid code conflicts between programmers in the same project
  3. Better overview of the view controllers and you can breakdown further in details for other storyboards.

RBStoryboardLink

https://github.com/rob-brown/RBStoryboardLink

This library is convenient in linking together the storyboards and handle the code transition without complicated procedure.

How

StoryboardLink1

1. Import the RBStoryboardLink library

2. Add view controller and name the class as RSStoryboard link

3. Connect a segue to it.

4.  At the runtime attributes of the (from) storyboard, you need to specify your (to) storyboard at storyboardName. For keypath needsTopLayoutGuide and needBottomLayoutGuide, you need to disable the boolean properties if you wish to eliminate the white space of the top and bottom of the screen.

That’s it! You only need few steps to organize your app better 🙂

References

http://www.newventuresoftware.com/blog/organizing-xcode-projects-using-multiple-storyboards/

http://spin.atomicobject.com/2014/02/18/ios-storyboards-xcode5/

http://spin.atomicobject.com/2014/03/06/multiple-ios-storyboards/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s