I'm Adam Preble and this is the bracing style I like. Please don't use it unless you (a) like it, or (b) are contributing to a project of mine.
- Braces go on the next line for:
- Method definitions.
if
blocks:- After
case
statements, but only if required by local variables within the case.
- Braces go on the same line on:
@interface
and@implementation
lines, when defining instance variables.switch
blocks- When passing a block 'inline' (preferred style of passing blocks).
@interface QRTEmbracer : NSObject {
// I don't put ivars in my header files,
// but if I did, they would be braced like this.
}
@end
@interface QRTEmbracer () {
int _count;
}
@end
@implementation QRTEmbracer
- (instancetype)init
{
if (self = [super init])
{
}
return self;
}
- (void)animate
{
[UIView animateWithDuration:1.0 animations:^{
switch (_count) {
case 0:
...
break;
case 1:
{
int zebras = _count * 2;
...
break;
}
}
}];
}
@end