Is there any shortcut key to align code in Xcode? Just like Ctrl+K+D in Visual Studio?
Select first the text you want to format and then press Ctrl + I . Use Cmd + A first if you wish to format all text in the selected file. Note: this procedure only re-indents the lines, it does not do any advanced formatting.
Xcode can fix this with one shortcut: select the code you want to fix, then press Ctrl+I to reindent it.
Choose Xcode > Preferences… from the menu bar (default shortcut: command-comma). Then click the “Text Editing” section. Then choose the “Indentation” tab.
Jump to Line ( ⌘ + L )
⌃ + i (ctrl + i) is the shortcut key equivalent to Editor > Structure > Re-Indent ( in Xcode 6.4)
This will re-indent the line the cursor is on if no text is selected, or it will re-indent your selection.
1.) Select the text you want to align,
then
2.) press ctrl(^) + I.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With