Xcode文件和文件夹清理结构和组织 [英] Xcode files and folders clean structure and organization

查看:136
本文介绍了Xcode文件和文件夹清理结构和组织的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用Xcode进行了四年开发之后,我开始问自己(嗯,是的,我知道,为时已晚,但是当您精于编码时,您看不到其他东西)文件的结构和组织是什么样的和文件夹可能是遵循某种准则的好人。

After four years in development with Xcode I started to ask myself (well, yes, I know, a little too late but when you are deep in coding you don't see other things) what kind of structure and organization of files and folders can be a good one to follow some sort of guidelines.

我看到Google 编码指南,我想知道是否存在与此问题相关的类似文档。

I saw Google coding guidelines and I wonder if there's any similar doc around for the subject of this question.

我可以看到,如果您使用Xcode创建一个新项目(我使用的是最新版本),则您将拥有一个与应用程序名称相同的文件夹,然后在支持文件中,然后是框架和产品。最后两个很好,但是我只是想知道是否添加一些图形,其他类和静态库等等,如何命名它们以及将它们放在哪里(例如:一些标准图形,例如图标和默认图像会放在一个支持文件中名为设计或标准设计的文件夹)。
这样的规则。

I can see that if you create a new project in Xcode (I'm using the latest version) you have one folder with the same name of the app, then inside "supporting files", then frameworks and product. The last two are fine, but I just wonder if I add some graphics and other classes and static library and so on, how I could name them and where to put them (ex: some standard graphics like icon and default image will go in a folder named "design" or "standard design" inside "supporting files"). Rules like that.

这是因为当您开始处理多个项目(我的意思是每天3-4个)时,您希望在同一文件夹中找到相同的内容,甚至因为对于将来的更新和参考,您将知道在正确的位置找到正确的东西。

This is because when you start to handle multiple project (and I mean 3-4 per day) you want to have find the same things in the same folder and even because for future updates and references, you will know where to find the right things in the right place.

推荐答案

我认为最好的策略是根据它们与程序功能相关的部分将它们按组进行组织(组是XCode中的文件夹 ,它们不是真正的文件系统文件夹,除非您明确地使它们如此)。在实际文件夹中是否也组织它们是否是一个好主意(有时我有时不这样做)是有争议的。

I think the best strategy is to organize them in groups (groups are the "folders" within XCode, which are not real filesystem folders unless you esplicitely make them such) according to what part of the program functionality they are related to. It is somewhat debatable whether also organizing them in actual folders is a good idea or not (sometimes I do sometimes I don't).

但是在开始组织分组的文件,您应该开始组织项目的结构。意思是系统地遵循与如何模块化项目,将代码放在何处(在何处表示在哪个类中)等相关的最佳做法。

However much before you start organizing the files in groups you should start organizing the structure of your project. And with that I mean systematically follow best practices related to how to modularize the project, where to put your code (where meaning in which classes) etc.

Matt Gallagher的 他的著名博客 CocoaWithLove 中每个Mac应用程序的设计 。他的本体分析还使组织团队变得不言而喻(事实上,他承认通过抄写项目的组名称来创建本体)。

A pretty good starting point on how to organize the project is Matt Gallagher's The design of every Mac application post in his renown blog CocoaWithLove. His ontological analysis also makes almost self-evident how to organize the groups (and in fact he admits to having created the ontology by transcribing the group names of a project).

这篇关于Xcode文件和文件夹清理结构和组织的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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