Search code examples
xcodexcode4directorycategories

Grouping classes in xcode


In Xcode (latest version), is there a option to group/put-in-a-folder/orginize-in-any-other-way classes that are found in the app folder? I am only asking because I am building an app and it already has more than a hundred classes and navigating them trough is really a pain. A nice way to categorize them would really hel to make the development easier. Also, if there is a way to do so, will it work with nib files as well?


Solution

  • Structure can be created in the organization of your files as listed in an Xcode project by creating groups. You can select the items you wish to group together and select "New Group from Selection" in the contextual menu available by right clicking on the selection, or from the file menu select New->Group from Selection. A group shows up in Xcode as a folder. These groups have no functional influence on your code, they merely help humans organize projects. You can nest groups inside other groups by creating new groups inside existing groups or moving groups by clicking and dragging.

    Xcode's project navigator does not necessarily reflect the organization of files as stored in the file system. Each file listed in an Xcode project is a link to the file on disk. Therefore this grouping will not move items in the file system. If you need to see in the Finder organization developed by grouping files in Xcode, you'll have to repeat the grouping in the Finder. Moving items around in the Finder may break links in the Xcode project, so files will have to be re-added to the Xcode project.