How to automatically sort by name in an Xcode project

I like when my files are sorted by name, but I can't seem to find a parameter in Xcode to allow sorting by name automatically in the project navigator (not right-clicking and sorting by name)? This is very annoying when I have to search for my files, not AZ, and it creates the file in an almost random position in the structure or in any folder / group.

I am using Xcode 6.4 (6E35b) as well as Xcode 7.0 beta 3 (7A152u).

+5
source share
2 answers

You can give sort-Xcode-project-file a try.

  • Download this script file and save it anywhere. For example, I save it in a folder named script in my project folder.

  • Change your Scheme . Go to Build -> Post-actions , then add a script.

  • Enter this line in your script. perl "${PROJECT_DIR}/script/sort-Xcode-project-file" "${PROJECT_FILE_PATH}/project.pbxproj" Keep perl "${PROJECT_DIR}/script/sort-Xcode-project-file" "${PROJECT_FILE_PATH}/project.pbxproj" these four double quotes. "

  • Remember to select your target from the "Provide build options from" drop-down menu.

  • Then, every time you build a project, files are sorted automatically.

enter image description here

+5
source

You can sort by right-clicking the project in the navigator, and you will have the option of sorting by name

+1
source

All Articles