Fix code indentation in Xcode
You can do this automatically in Xcode 11
- select text
- press
Control-I
(the default keyboard shortcut)
Before Xcode 9 (for Xcode 9 see default shortcut below)
- select text
- right-click
- there's a "Re-indent selection" item in popup menu
In XCode 4 there is one more step:
- select text
- right-click
- Click on "Structure"
- there's a "Re-indent selection" and other options in popup menu
Or using the default shortcut:
- select text
- press ctrl + i