I like having my files sorted by name, but I don't seem to be able to find an option in Xcode to allow me to sort by name automatically in the project navigator (not the right click and sort by name)? This is very annoying when I have to hunt for my files and it's not A-Z and it creates the file at almost random position in the structure or if in any folder/group.
I'm using Xcode 6.4 (6E35b) and also have Xcode 7.0 beta 3 (7A152u).
There is an option to sort by name by right-clicking on a folder in Xcode, and then tapping "Sort by Name." The caveat is that you have to do this for each directory.
You can give sort-Xcode-project-file a try.
Download this script file and save it to somewhere you know. For example, I save it to a folder named script
under my project folder.
Edit your Scheme
. Go to Build -> Post-actions
then add a script.
Enter this line to your script. perl "${PROJECT_DIR}/script/sort-Xcode-project-file" "${PROJECT_FILE_PATH}/project.pbxproj"
Watch out for these four double-quotes "
.
Don't forget to choose your target from the "Provide build settings from" dropdown menu.
Then everytime when you build your project, the files are sorted automatically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With