Check out example codes for "xcode format code". It will help you in understanding the concepts better.

Code Example 1

Cmd + A then Ctrl+I

or

1. Select the block of code that you want indented.
2. Right-click (or, on Mac, Ctrl-click).
3. Structure > Re-indent

Learn ReactJs, React Native from akashmittal.com