-
Notifications
You must be signed in to change notification settings - Fork 9
Code and Comment Style Guidelines
geerlingguy edited this page Aug 25, 2012
·
2 revisions
Non-trivial methods should have a docblock formatted like the example below after the first line and opening bracket, and lines should wrap at 80 characters, like so:
- (void)methodNameHere {
/**
* First line of comment.
*
* Blank line between paragraphs. Wrap at column 80 (helps a ton on my 11"
* MacBook Air!).
*/
// Code...
}
Inline comments should be complete sentences, and should be brief, only added when they will add clarity to what's happening in the code. Inline comments should typically be one line, but if you need to wrap at 80 characters, continue using //
to indicate new lines of the comment.
@implementation
declarations, #pragma mark
s, and @end
declarations should have two blank lines before them. Files should always end with a blank line, and there should never be trailing white spaces.