- Install Alcatraz
- Install ClangFormat Plugin
- Restart Xcode
- Download .clang-format.yml to your home directory
curl -L -o ~/.clang-format https://gist.githubusercontent.com/dev4dev/78d0508304558e969b2a/raw/9bab5aefe2e29f4b7b6a5560642618e1e78b397c/.clang-format.yml
- In Xcode select menu
Edit
->Clang Format
->File
to use rules from downloaded .clang-format file - Use menu items
Edit
->Clang Format
->Format *
to format code - (Optional) If you are a lazy ass, you can select
Edit
->Clang Format
->Enable Format on Save
, thus code will be formatted right before saving to a file