96

When I import my project from Github, I have two folders which appear in Xcode with a blue color, but all the other folders are yellow. What's going on?

jscs
  • 63,694
  • 13
  • 151
  • 195
samir
  • 4,501
  • 6
  • 49
  • 76
  • 4
    This means you brought in the folders as folder references rather than file groups. Folder references are treated the same way a resource file is (i.e. as a single entity.) File groups are used for arranging code/items in the IDE. – Jonathan Grynspan Apr 27 '12 at 15:24

1 Answers1

74

Blue is used to represent a "Folder Reference".

A clear description of what these are and when to use them comes from http://struct.ca/2010/xcode-folder-references/

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.

rcourtna
  • 4,589
  • 5
  • 26
  • 27
  • 36
    The answer is not strictly correct. You can still have Yellow folders which map to real directories in the file system _in your XCode project_. The difference with Blue folder is that they also map to real folders in the deployed bundle of the app. So the use case for blue folders described in this answer applies to yellow folders too. The real use case for blue folders is if your app needs to separate assets too (eg if there are resources with the same name but different file paths) See http://stackoverflow.com/questions/10380842/uiimage-imagenamed-requires-pathforresource/12932540#12932540 – Rhubarb Jan 08 '14 at 14:53
  • 1
    Xcode 9 introduced a new feature where a Project Navigator Group can now be _**expressly associated** with a file system directory_. Related: ["What does the dark triangle, located on the folder icons in Xcode 9, mean?"](https://stackoverflow.com/questions/45834784/what-does-the-dark-triangle-located-on-the-folder-icons-in-xcode-9-mean/47973616#47973616) – marc-medley Dec 26 '17 at 19:49
  • 2
    @Rhubarb that comment would be helpful as an answer to this question. – pkamb Jun 06 '20 at 21:33