Taking a question with a different meaning, the best way to format this code is to use Xcode.
Select the code for formatting, then in Edit → Format → Re-Indent, and you will get the code in the standard Xcode format.
I matched it with the keyboard shortcut alt-cmd- [since I was used for TextMate. He was buried under many menus, so a keyboard is convenient for this. If you use TextMate, click inside the block to format and press ctrl-Q. However, TextMate has some problems with this formatting style.
source
share