简体   繁体   中英

How to collaborate on a project with Xcode Storyboards?

For a project I am developing for iOS, I want to collaborate with some freelancers. For collaborating on 'pure' code I want to use GitHub. But a big portion of the work, will be on the Storyboards and the connection with the code. What is good practice here? How do I share the Xcode project with them, so they can work on some elements (branches maybe), somewhat similar to the GitHub method? Or is there a good alternative?

Anybody got any advice in this matter? Help is much appreciated!

As one of the comments pointed out, Storyboards are just XML files. That means git can easily upload them to Github. As to your initial question, you have to be careful not to modify the same views as your freelancer did, for if you do so, it will give you a merge conflict. What will happen then is that GitHub will modify the storyboards XML file inserting the <<<<<<< HEAD / >>>>>>> commit Id tags to show you where you have both changed something. This will then mess up the graphical storyboard and likely lead to Xcode no longer being able to open the Storyboard. This will throw the following error:

"Main.storyboard"could not be opened. The operation couldn't be completed. (com.apple.InterfaceBuilder error -1.)

To avoid that, simply edit other views, or always pull before starting to edit anything in the Storyboard. And even when using branches, when you'll try to merge you'll run into the same problem. However, it's noteworthy that you could just be working on different branches and the manually apply all the changes to one storyboard. This is tedious, but it works.

Hope that helps, Julian

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM