kodecocodes / objective-c-style-guide

A style guide that outlines the coding conventions for Kodeco
http://www.raywenderlich.com/62570/objective-c-style-guide
3.1k stars 625 forks source link

Xcode behavior regarding indenting block #76

Open igor9silva opened 7 years ago

igor9silva commented 7 years ago

Does anyone know how to make Xcode auto-indent blocks correctly?

What I mean is that, according to this guide and to what I think is a much cleaner and readable code, blocks should be indented like the following:

Preferred:

// blocks are easily readable
[UIView animateWithDuration:1.0 animations:^{
  // something
} completion:^(BOOL finished) {
  // something
}];

Not Preferred:

// colon-aligning makes the block indentation hard to read
[UIView animateWithDuration:1.0
                 animations:^{
                     // something
                 }
                 completion:^(BOOL finished) {
                     // something
                 }];

But Xcode keeps wrongly indenting the inside-block code every semi-colon I type!