Skip to content

Commit

Permalink
Merge pull request google#269 from google/update-objc
Browse files Browse the repository at this point in the history
[objc] Update the Objective-C style guide 📜
  • Loading branch information
stephanemoore authored Aug 24, 2017
2 parents de57aca + 82d0af2 commit 0c88671
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions objcguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ example that should give you a feel for the style, spacing, naming, and so on.
Here is an example header file, demonstrating the correct commenting and spacing
for an `@interface` declaration.

Doxygen-style comments are encouraged for interfaces as they are parsed by Xcode
to display formatted documentation. There is a wide variety of Doxygen commands;
use them consistently within a project.

```objectivec
// GOOD:

Expand Down Expand Up @@ -90,7 +86,7 @@ An example source file, demonstrating the correct commenting and spacing for the
#import "Shared/Util/Foo.h"
@implementation Foo {
// The string used for displaying "hi".
/** The string used for displaying "hi". */
NSString *_string;
}
Expand Down Expand Up @@ -882,6 +878,10 @@ categories, protocol declarations, and enums.
@end
```

Doxygen-style comments are encouraged for interfaces as they are parsed by Xcode
to display formatted documentation. There is a wide variety of Doxygen commands;
use them consistently within a project.

If you have already described an interface in detail in the comments at the top
of your file, feel free to simply state, "See comment at top of file for a
complete description", but be sure to have some sort of comment.
Expand Down Expand Up @@ -1015,7 +1015,7 @@ Examples of strong and weak declarations:
IBOutlet NSButton *_okButton; // Normal NSControl; implicitly weak on Mac only

AnObjcObject *_doohickey; // My doohickey
MyObjcParent * __weak _parent; // To send messages back (owns this instance)
__weak MyObjcParent *_parent; // To send messages back (owns this instance)

// non-NSObject pointers...
CWackyCPPClass *_wacky; // Strong, some cross-platform object
Expand Down

0 comments on commit 0c88671

Please sign in to comment.