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.

First only

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.


Help me write and make more!

You can help me continue to provide valuable content like this. If you found this article helpful, please consider supporting me.

Coffee Pizza Dinner