Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
* Declare properties `readonly` if they are only set once in `-init`.
* Don't use `@synthesize` unless the compiler requires it. Note that optional properties in protocols must be explicitly synthesized in order to exist.
* Instance variables should be prefixed with an underscore (just like when implicitly synthesized).
* Don't put a space between an object type and the protocol it conforms to.

```objc
@property (attributes) id<Protocol> object;
@property (nonatomic, strong) NSObject<Protocol> *object;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the more common id<Protocol> example would help. Perhaps also add that, where possible, extend a new protocol from the root <NSObject> protocol. That would be nice...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this example should include id<Protocol> and NSObject<Protocol> * (to show the two styles), which is what I meant by my original comment.

@galaxas0 This guide is not meant to be as exhaustive as you're suggesting. We only want to list items that are non-obvious, and extending <NSObject> is very common Cocoa convention.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jspahrsummers Oh, alright, I did indeed misunderstand the extensiveness of this guide... thanks! 👍

```

* C function declarations should have no space before the opening parenthesis, and should be namespaced just like a class.

```objc
Expand Down