XCode Trick: Sort Files Alphabetically By Name

You know the drill. After adding a ton of Models and/or ViewControllers to your growing project, finding anything in your XCode project navigator is a nightmare. Good thing there is the Command + Shift + O for the quick find! Yet, it still doesn’t feel good to have a complete mess.

Luckily, there is a quick and easy solution for organizing your files alphabetically to turn this:

XCode-Mess-Navigation

into this:

XCode-Navigation-Alphabetical

Yes, in case you were wondering, I have had projects with a lot more ViewControllers and Models where I had actually manually did the alphabetical clean-up!

No more! Today, I read on Tony Arnold’s blog that there is a quick and easy shortcut to this.

Just right click on the group you want to organize (in my case ViewControllers), and select the “Sort by Name” option. Boom! Done.

XCode-sort-by-name

Enjoy a clean project navigator!

Enjoy the article? Join over 14,500+ Swift developers and enthusiasts who get my weekly updates.