如何与Xcode Storyboards合作项目? [英] How to collaborate on a project with Xcode Storyboards?

查看:89
本文介绍了如何与Xcode Storyboards合作项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我为iOS开发的项目,我想与一些自由职业者合作。对于'纯'代码的合作,我想使用GitHub。
但大部分工作将在故事板上以及与代码的连接上。
这里有什么好的做法?我如何与他们共享Xcode项目,以便他们可以处理一些元素(可能是分支),有点类似于GitHub方法?
还是有一个很好的选择?

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!

推荐答案

作为其中一条评论指出,Storyboard只是XML文件。这意味着git可以轻松地将它们上传到Github。至于你最初的问题,你必须小心不要修改与你的自由职业者相同的观点,因为如果你这样做,它会给你一个合并冲突。接下来会发生什么是GitHub将修改故事板XML文件,插入<<<<<<<<<< HEAD / >>>>>>>提交Id 标签来显示你在哪里改变了某些东西。这样就会弄乱图形故事板,并可能导致Xcode不再能够打开故事板。这会引发以下错误:

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无法打开。操作无法完成。 (com.apple.InterfaceBuilder错误-1)。

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

为了避免这种情况,只需编辑其他视图,或者在开始编辑之前总是拉动Storyboard中的任何内容。即使在使用分支时,当你尝试合并时,也会遇到同样的问题。但值得注意的是,您可以在不同的分支上工作,并手动将所有更改应用到一个故事板。这很乏味,但它有效。

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

这篇关于如何与Xcode Storyboards合作项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆