Skip to content
BigZaphod edited this page Mar 24, 2011 · 22 revisions

Code Style Guide

While I prefer tabs, I think Xcode may be defaulting to 4 spaces now. So use either real tabs or 4 spaces to indent stuff.

Put the curly braces of method bodies on their own lines, but inline for if/else/etc blocks:

- (void)addClip
{
	[self _setContextPath];
	
	if (_usesEvenOddFillRule) {
		CGContextEOClip(UIGraphicsGetCurrentContext());
	} else {
		CGContextClip(UIGraphicsGetCurrentContext());
	}	
}
Clone this wiki locally