Adding Folders of Files to Xcode Projects

When you add a folder of files to an Xcode project by choosing File > Add Files to “ProjectName”, you should see the following options at the bottom of the Open panel:

add folders

As you can see there are two options for adding folders to a project.

  • Create groups
  • Create folder references

What’s the difference between creating groups and folder references?

When you create a group for a folder, Xcode creates a gray folder (yellow folder in earlier Xcode versions) for the folder in the project navigator. Create a group when you need to edit the folder’s files in Xcode. If you’re adding a folder of source code files, you should create a group for the folder.

When you create a folder reference, Xcode creates a blue folder in the project navigator. The folder will also be copied to the app bundle when you build the project. Create a folder reference when you don’t need to edit the folder’s files in Xcode. If you’re adding a folder of image or sound files, you should create a folder reference.

Get the Swift Dev Journal Newsletter

Subscribe and get exclusive articles, a free guide on moving from tutorials to making your first app, notices of sales on books, and anything I decide to add in the future.

    We won't send you spam. Unsubscribe at any time.