xcode iOS - 在故事板中管理代码合并的最佳实践
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29263725/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
iOS - best practice for managing code merge in a storyboard
提问by j2emanue
Merging in a xcode storyboard with many team members can produce many conflicts etc. I need a strategy to share a storyboard with 20 team members but to avoid the nightmares associated with merging code in a storyboard.
与许多团队成员合并 xcode 故事板会产生许多冲突等。我需要一种策略来与 20 个团队成员共享故事板,但要避免与在故事板中合并代码相关的噩梦。
I thought of having a separate target per team in xcode but this doesn't do well as we all need the updates so having two story boards is not good practice.
我想过在 xcode 中为每个团队设置一个单独的目标,但这并不好,因为我们都需要更新,因此拥有两个故事板并不是一个好习惯。
my code base is inherited. its a forked project that is storyboard heavy already. I think changing to xib might be difficult (??)
我的代码库是继承的。它是一个分叉的项目,故事板已经很重了。我认为更改为 xib 可能很困难 (??)
采纳答案by Anish Parajuli ?
Check out thistutorial which clearly suggests not using a storyboard
while working on team.
查看本教程,其中明确建议不要storyboard
在团队工作时使用。
But you can divide team into each module and use some versioning system as bitbucket or git to manage your code with the help of multiple storyboards(separate storyboard for separate module).
但是您可以将团队分成每个模块,并使用一些版本控制系统作为 bitbucket 或 git 在多个故事板(单独模块的单独故事板)的帮助下管理您的代码。
Careful day by day commit and pull will definitely resolve conflicts.
每天小心提交和拉取肯定会解决冲突。
回答by Justin Vallely
Our team has found the majority of Michael Behan's method to work well. ?Boom
我们的团队发现 Michael Behan 的大部分方法都运行良好。?繁荣
- Everyone on the same build of Xcode
- Multiple storyboards
- Use Nibs for custom views
- Think about which storyboards are involved when assigning tasks
- Merge storyboards often
- 每个人都使用相同的 Xcode 版本
- 多个故事板
- 使用 Nibs 自定义视图
- 分配任务时考虑涉及哪些故事板
- 经常合并故事板