I want to move a file I have in PROJECT/PROJECT.xcodeproj to PROJECT/Classes.
The problem with just dragging within Xcode is that Xcode's file hierarchy system is different from the actual system.
The problem with moving it within Finder/Terminal is that it breaks things and things no longer work.
Please let me know of a solution. Thanks!
You can create a new group, with its own folder, directly in Xcode, but it's not at all obvious. Instead of choosing 'New Group', choose 'Add Files to “<Project>”'. Then, in the file picker dialog, click the New Folder button or press Command-Shift-N and type the name of the new folder/group.
Click the arrow button to the right of the file and select Move or Copy file from the dropdown menu. When you choose Copy this file from the move or copy dropdown, you will then be able to select which project to copy it to. You can make a copy of the file in the existing project or in another project.
Xcode offers several ways to add existing files and folders to your project: Drag the files from the Finder into the Project navigator. Click the Add button (+) in the Project navigator's filter bar, and choose Add Files to “projectName”. Choose File > Add Files to “projectName”.
Works in Xcode 5:
⌘⌥0
)This allows you to both move files and rename them (both at once if you like).
Edit: Notably, Xcode 9 supposedly will move files on the filesystem if your group structure mimics the file system.
I have had the same issue. Groups do not represent folders in the file system. I solved my problem by
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