Storyboards and Conflicts SVN

This is a problem that we never had to face until storyboards were presented. Whenever there was a chance of conflict in the user interface, we simply made sure that no developer worked on the same XIB file at the same time. The reason we refrained from resolving XIB conflicts is that there may be problematic side effects (XIB is presented in XML format, so there is no β€œgood” way to combine 2 versions).

Now we are faced with this problem, because all our user interface elements are in the same .storyboard file - preventing the simultaneous work on any 2 user interface elements in the project makes it difficult to work in parallel.

Any suggestions on how to solve this problem? Thanks in advance for your efforts.

+42
ios svn storyboard
Jul 18 '12 at 9:40
source share
4 answers

Break your storyboard into several storyboards.

Your application has no reason to contain only one storyboard. Break your storyboard into modular storyboards. You can use +storyboardWithName:bundle: to load storyboard modules.

See: Best UIStoryboard recommendations for other good storyboard ideas.




Update

It is important to note that this is not a complete solution to the problem. Similarly, you cannot completely avoid the possibility of merge conflicts in the source code by decomposing a giant class into smaller modules, and you cannot avoid script merge conflicts. The idea is to reduce the chance until it becomes a manageable problem.

A large code base will always have complex merge situations. A properly laid out solution will reduce the number of conflicts and minimize the number of locks required.

+38
Jul 20 2018-12-12T00:
source share

This is what I came up with when I was just messing around trying to find a solution.

If you right-click your storyboard file in Xcode and go to "Open As", you will see that there are several options - the default is "Interface Builder - iOS Storyboard". However, you can also select "source code".

If you open the storyboard in source mode, it’s possible to make changes (although this is a pain). But you can add code from other storyboards and make changes yourself - I did not use SVN, but with the git repository I can view other versions of the storyboard and copy the code.

I would not say that this is a great solution. I had some problems with Xcode accidentally crashing when I try to open the storyboard again in IB. Sometimes embed code in work, sometimes it is not. Several times I had to change the value of the <scene> . In my experience, this is pretty good or missed, but if you back up your files before trying anything, it might work.

If this works, let me know - I am interested to know if a solution to this problem can be found.

0
Jul 20 2018-12-12T00:
source share

Is it about merging XML files?

Fortunately, SVN allows you to modify the merge tool that you use to perform merging for different types of files. (e.g. tutorial on using P4Merge )

So, now you just need to find a great tool for merging XML files (good luck :))

there is WinMerge (with a preliminary filter DisplayXMLFiles) or diffxml, or XMLMerger or java xmlmerge

0
Jul 20 2018-12-12T00:
source share

You can also take a look at a modern source code management tool. Git, for example, has smart merge features. See this link for why you should consider updating your workflow.

-3
Jul 20 '12 at 12:12
source share



All Articles