~ 1 min read

clang-format Style File for iOS Projects

A simple clang-format style file that will get you 80% of what you want with 20% of effort (or even less):

BasedOnStyle: Chromium
AlignTrailingComments: true
BreakBeforeBraces: Attach
ColumnLimit: 0
IndentWidth: 4
KeepEmptyLinesAtTheStartOfBlocks: false
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PointerBindsToType: false
SpacesBeforeTrailingComments: 1
TabWidth: 8
UseTab: Never

The only significant difference you may want to make is with BreakBeforeBraces. I prefer opnening bracket on the same line - makes the code more compact and looks better imo.

Learn how to simplify preformatting of the whole folder with clang-format