NEW BOOK! Swift Gems: 100+ tips to take your Swift code to the next level. Learn more ...NEW BOOK! Swift Gems:100+ advanced Swift tips. Learn more...
Quick Tip Icon
Quick Tip

Re-indent selected code in Xcode

Xcode provides support for a lot of useful keyboard shortcuts to speed up our development process.

Often when we copy code from somewhere, it comes with the wrong indentation.


We can re-indent selected code in Xcode by pressing Ctrl + I.

To re-indent the whole file: Command + A then Ctrl + I.