Xcode 16 refactoring shortcut
I've been playing around with Xcode-16.0.0-Beta
and I accidentally discovered a nice little shortcut.
You're able to select an entire code block - struct
, class
, enum
, whatever - and cut it from a file, and paste it directly into the project sidebar.
This will automatically create a new file for you and appropriately name it the struct
, class
, etc.
I know it's not much, but it's one of those little things which when you write long files with all the working code and then have to refactor it out into smaller files, it's one less thing to worry about.
You simply cut, paste, cut, paste.
I haven't fully tested it, but when selecting more than one code block it seems to only name the file the first one rather than creating multiple files.
If you found this article helpful, you can keep the ideas flowing by supporting me. Buy me a coffee or check out my apps to help me create more content like this!
Coffee Check out my apps