Storyboards and SVN conflicts

Stavash picture Stavash · Jul 18, 2012 · Viewed 10.8k times · Source

This is a problem we never had to deal with until storyboards were introduced - Whenever there was a chance of conflict in UI, we just made sure that no 2 developers ever worked on the same XIB file simultaneously. The reason we refrained from resolving XIB conflicts is that there may be problematic side-effects (XIB is represented in XML format so there isn't a "good" way to merge 2 versions).

Now we are facing this issue because all of our UI elements are within the same .storyboard file - prevention of simultaneous work on any 2 UI elements in the project makes working in parallel very difficult.

Any suggestions as to how to tackle this issue? Thanks in advance for your efforts.

Answer

Jeffery Thomas picture Jeffery Thomas · Jul 20, 2012

Break up your storyboard into multiple storyboards.

There is no reason for your app to contain only one storyboard. Break your storyboard up into module storyboards. You can use +storyboardWithName:bundle: to load storyboard modules.

See: UIStoryboard Best Practices for other good storyboard ideas.


Update

It's important to note this is not a complete solution to the problem. In the same way you cannot completely avoid the possibility of merge conflicts in source code decomposing a giant class into smaller modules, you can't avoid the possibility storyboard merge conflicts either. The idea is to reduce the likelihood until it becomes a manageable problem.

There will alway be tricky merge situations in a large codebase. A properly decomposed solution will reduce the number of conflicts and minimize the number of lock out needed.