user314783
user314783

Reputation: 179

Taming Xcode Storyboards

I've inherited a project that uses ~100 Xcode storyboard scenes. Trying to add to this project has been a nightmare for the following reasons:

I've spent hours googling solutions and nothing useful has appeared. Any suggestions on how to improve the storyboards situation or pointers to things in XCode I've stupidly overlooked?

Disclaimers:

a) I am well aware that moving to nibs would solve the problem and 100 storyboard scenes is nuts, but I've inherited the code and I'm expected to do storyboards for at least the next year.

b) I'm aware that it's possible to split out the project into several storyboards. I might look into this if I have time.

c) I've heard that some problems may be caused by having two storyboards open at once, which I've tried to avoid as much as possible.

d) Filing a bug with Apple's regarding storyboards is already on my to-do list.

Upvotes: 1

Views: 406

Answers (1)

Aaron Brager
Aaron Brager

Reputation: 66224

First, work on splitting your storyboard up into smaller storyboards. I would recommend a maximum of 4-5 view controllers per storyboard. It will be a giant headache at first, just work on it over time. Take a look at RBStoryboardLink, which allows you to connect them "by allowing 'pseudo-segues' between UIStoryboards. These segues can be built without leaving Interface Builder and without writing any extra code". This will give you:

  1. The ability to make abstract super classes in storyboards for very similar view controllers
  2. Smaller, more manageable files that don't bring your computer to a halt
  3. Fewer merge conflicts when working as part of a team (assuming your project is under version control)

Second, tell your boss to immediately purchase you a new, way better development computer. They'll make back the $3-$4k in more efficient development time in a matter of days. (Or, if this is contract work… buy a new one yourself.)

And, please indulge my slightly off-topic comment.

Regarding this statement:

I'm expected to do storyboards for at least the next year

Work expectations are always negotiable. Your boss likely thinks "switching from storyboards to code will cost more time than it will save." If this isn't true, say so.

Upvotes: 2

Related Questions