Closed stigi closed 1 year ago
@stigi, do you have a mark for delegate methods or is that what you mean within the "SecretNotVisibleFromHeaderProtocol" mark?
One note -- we usually use pragma sections to group methods, and then marks in between them to denote subgroups. So:
#pragma mark - SecretNotVisibleFromHeaderProtocol
not
#pragma mark SecretNotVisibleFromHeaderProtocol
For example:
#pragma mark - Table View
#pragma mark UITableViewDatasource
. . .
#pragma mark UITableViewDelegate
. . .
This is addressed in https://github.com/NYTimes/objective-c-style-guide/pull/80.
:+1:
Closes #44.
Unless I am missing something, this PR does not address ordering of class vs. instance methods.
Unless I am missing something, this PR does not address ordering of class vs. instance methods.
Whoops, it was supposed to. I’ll get right on that.
Cool
Hi,
I'm pretty sure you're using pragma marks a lot.
I'm curious what's your best practise to structure code then.
Here's an example from us (@nxtbgthng):
We usually structure our implementation files like so like so (let's call this one Class.m):
So key points are:
Lifecycle
section to group all init and deallocClass Methods
section to group all static methodsAccessors
section to group all custom getters and setters@synthesize
/@dynamic
close to the getter/setterThanks for sharing your style guide. It's pretty close to how we do it which is a good sign for both of us ;)
-ullrich