Creating a Group in Xcode 9 now actually creates a directory on disk?

First thing I do when I create new project is make a "Supporting Files" Xcode Group (the yellow folder, which was always just a "group" in Xcode but never moved files on disk).


Now if I create a new "Group" called supporting files, and move the info.plist, asset.catalog and .entitlements to it, the project won't compile and you have to manually tell Xcode where the files are. If this is intended behavior that "Grouping" concept in Xcode is no more? Xcode should atleast be able to update its reference to the path on disk, instead of move the file, and then sayig it doesn't know where it is.

Replies

34686156

I just noticed there is now context menu items:


"New Group"


and


"New Group without Folder".


What's weird is that in a new project if you choose "New Group" it creates an actual directory (breaking with Xcode's previous behavior as already mentioned). But I noticed if you create a new project and before creating any "Group" you choose "New Group without Folder" then the "New Group" menu item creates groups without folders (the old way).


So the meaning of the context menu item "New Group" changes based on whichever grouping style you choose first. Seems pretty convoluted to me.

Quoting from the release notes, FWIW (might want to scan for more, etc.):


Projects

New Features

  • Groups in the Project Navigator are now more closely associated with directories in the file system. (28612132)
    • Dragging files between groups in the Project Navigator moves the files in the filesystem and updates any associated SCM working copies.
    • When a group is connected to folder in the filesystem, creating, renaming, and deleting groups updates the corresponding files and folders in the the filesystem.
    • To remove a connection between a group and a folder in the filesystem, select the group, and then open the File inspector and click on the on the Clear path button (X).
    • To add or update an association from a file or a folder in the filesystem to a file or a group in the project, select the file or group, open the File inspector, and drag the corresponding file or folder onto the Location section in the File inspector.
  • Known Issues

  • Dragging a file into a project from the Finder may move or copy the file in the Finder. (31042020)Workaround: Create a reference to the file by Command-Option dragging the file into the project.
  • Thanks for noticing this. It is absolutely horrible UI design to have the meaning of those menu items change depending on your very first action .. but at least you figured it out.


    Ugh!

    More than a bit late, but for anyone else coming here... Xcode decides the action of 'New Group' based on how many of the groups of the parent are groups with folders. A majority being folders makes it choose to make a folder, a majority not having folders makes it choose the other way.


    Under 'New Group', there will always be either 'New Group with Folder', or 'New Group without Folder' which will be the opposite action to the one 'New Group' will do.