Restructuring files in Xcode

·

1 min read

Oh such pain.

Ensure you select:

  • Copy file if needed
  • Groups (not references)

Here's one way to do it

  • Delete the reference to the file
  • Organise the files properly using Finder
  • Drag and drop the new files / folders back into Xcode

Then build. If you have build issues, do the following one at a time

  • Clean
  • Restart
  • Delete the entire derived data folder (go to Preferences > Locations to find the path to the derived data folder)
  • If Xcode has lost references to your SDKs, then restart again. If this still doesn't fix it, then File > Swift Packages > Resolve Package Versions