In Xcode, what is the difference between a folder and a group? Are these interchangeable terms or is there a subtle difference?
5 Answers
Groups
With groups, Xcode stores in the project a reference to each individual file.
Folders
Folder references are simpler. You can spot a folder reference because it shows up in blue instead of yellow.
There are two types of folders in Xcode: groups and folder references. You can use groups to organize files in your project without affecting their structure on the actual file system. This is great for code, because you’re only going to be working with your code in Xcode. On the other hand, groups aren’t very good for resource files.
On any reasonably complicated project, you’ll usually be dealing with dozens – if not hundreds – of asset files, and those assets will need to be modified and manipulated from outside of Xcode, either by you or a designer. Putting all of your resource files in one flat folder is a recipe for disaster. This is where folder references come in. They allow you to organize your files into folders on your file system and keep that same folder structure in Xcode.

- 38,237
- 7
- 103
- 107
-
Are groups flagged with the yellow folder icon then? – hinterbu Dec 10 '15 at 21:14
-
2Yellow folders are "Groups", they are not actual folders but references to folders/files. They exist only to organize your project in Xcode. @hinterbu – Rashwan L Dec 10 '15 at 21:17
-
1Cool, I just did some testing and understand it in full now. Thanks to both you and @DBoyer. Huge help. – hinterbu Dec 10 '15 at 21:22
-
1Np glad to help out :) @hinterbu – Rashwan L Dec 10 '15 at 21:23
-
Just to add. Using Group will tell XCode to dump all the assets in the root of your .app. While using the Folder option will also make these folders inside the .app. – TheNitram Jul 13 '17 at 01:05
A folder in Xcode represents a folder in the file system.
A group in Xcode is a "fake" folder which does NOT represent a folder in the file system.
It is common to use a combination of groups and folders for a given Xcode project.

- 3,062
- 4
- 22
- 32
Xcode behavior (starting with v9) has changed and groups are now actual folders on-disk.

- 11,044
- 8
- 69
- 129

- 4,314
- 35
- 45
-
1But it seems that groups are not actual folders; Xcode 9 just link the group to the real folder, but actually they behave like older version. It's a feature Apple implemented to avoid have different folder struct than xcode one – Rico Crescenzio May 28 '18 at 11:50
-
legacy projects continue with the old behavior (folders as logical groupings) but new projects (and new groups in old projects) use physical folders for groups. – software evolved Jul 07 '18 at 15:46
-
3This isn't quite true. Groups by default now *track* folders, but you can easily cancel that in the inspector by un-tracking the folder. When it is tracking and you rename a group, etc. then yes, it modifies the actual on-disk folder, but when you stop tracking, it behaves just like it was before... a logical grouping within the project of whatever you place under it for structural purposes only (you'll see a tiny triangle on it indicating if it's tracked or now.) So yes, they can track a folder, but they are not 'actual' folders. That's what I was calling out with this comment. – Mark A. Donohoe Jan 20 '20 at 19:26
I found that Xcode 9.2 has two versions of group when you create a group. One is group
the other is group without folder
. The first one also creates folder in your file system, the second one doesn't.

- 560
- 9
- 9
I was following a tutorial and it had me drag a nested folder with a number of autogenerated Swift files with public classes and structs. I missed that I was supposed to click the "Create groups" and not "Create folder references". When I added the folders/paths using the incorrect 'folder ref', my other scripts did not see these public objects. When I did it the right way, added them using 'groups', then they were recognized in other scripts. I think this is in keeping with TheNitram's comment, that 'group' adds to the root ...

- 1
- 1