Something funny has happened starting in Xcode 16. When I create a project, that project's files appear in alphabetical order in the Project Navigator, and cannot be rearranged by dragging as they could in the past.
Here is a screen shot of a new project's Project Navigator:
I can try to drag, say, AppDelegate.swift to a different position, to clump the Swift files together, but I can't do it. What gives?
What's going on here?
As the release notes explain, there's a new kid on the block in the world of "folders" in the Project Navigator.
There used to be two kinds of entity drawn as a folder in the project navigator: Groups, and Folders. A Group is a way of clumping files together, for convenience, just within the project navigator itself. A Folder is basically a group that corresponds to a folder on disk; in other words, it has a "physical" reality beyond the project navigator hierarchy.
Okay, so Xcode 16 introduces a whole new way of encoding the project and its contents internally. It used to be that, whether we're talking about a Group or a Folder, every single file in the project navigator had to be listed individually in the project file (project.pbxproj, hidden inside MyCoolApp.xcodeproj or whatever your project's name is). But this caused frequent merge conflicts among team members using Git to collaborate on a project, with the result that the pbxproj file had to be edited by hand to resolve the conflict — scary, and with the predictable outcome that all too often the entire project would be ruined.
Xcode 16's solution is to let you say, Hey Xcode, here's a folder full of files. Look at the folder, on disk. Every file in that folder should be an individual file in the project, and you should list it in the Project Navigator. This is called a buildable folder.
Okay, so under that regime, when you create a new project in Xcode 16, the initial "folder" containing your project's files in the Project Navigator is a buildable folder. There is only one entry in the pbxproj file: the buildable folder. Thus, in my screenshot in the question above, there is no entry in the pbxproj for AppDelegate.swift, for SceneDelegate.swift, and so on. They are present in the "folder" in the Project Navigator because Xcode looked right at the contents of the MyCoolApp folder on disk and listed its contents.
Well, those contents are listed in alphabetical order, and that's that.
Now, if you don't like this innovation, you can still make this "folder" a group. Just Control-click on the "folder" in the Project Navigator and choose Convert to Group. Now the files are all listed individually in the pbxproj as in the past, and you can drag-and-drop to rearrange the files as in the past. The inverse operation exists too: you can Control-click on a "folder" representing a group, and choose Convert to Folder.
The downside of all this is that the word "Folder" is now being used in rather a lot of different ways. Aside from the "folder" term which I use to designate a kind of listing in the Project Navigator, such a "folder" can now represent a Folder (meaning, for purposes of this discussion, a Buildable Folder), a Group (tied to a folder on disk), or a Group Without Folder (purely for purposes of organization within the Navigator).