Skip to content

Commit 3995626

Browse files
committed
Copy tweaks for Dot-Notation Syntax and Variables sections. Added description for Dot-Notation. Removed Image Naming section.
1 parent 554f7bf commit 3995626

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

README.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ Here are some of the documents from Apple that informed the style guide. If some
4545
* [CGRect Functions](#cgrect-functions)
4646
* [Golden Path](#golden-path)
4747
* [Error handling](#error-handling)
48-
* [Image Naming](#image-naming)
4948
* [Singletons](#singletons)
5049
* [Line Breaks](#line-breaks)
5150
* [Smiley Face](#smiley-face)
@@ -256,7 +255,9 @@ Variables should be named as descriptively as possible. Single letter variable n
256255

257256
Asterisks indicating pointers belong with the variable, e.g., `NSString *text` not `NSString* text` or `NSString * text`, except in the case of constants.
258257

259-
[Private properties](#private-properties) should be used in place of instance variables whenever possible. Direct access to instance variables that 'back' properties should be avoided except in initializer methods (`init`, `initWithCoder:`, etc…), `dealloc` methods and within custom setters and getters. For more information on using Accessor Methods in Initializer Methods and dealloc, see [here](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmPractical.html#//apple_ref/doc/uid/TP40004447-SW6).
258+
[Private properties](#private-properties) should be used in place of instance variables whenever possible. Although using instance variables is a valid way of doing things, by agreeing to prefer properties our code will be more consistent.
259+
260+
Direct access to instance variables that 'back' properties should be avoided except in initializer methods (`init`, `initWithCoder:`, etc…), `dealloc` methods and within custom setters and getters. For more information on using Accessor Methods in Initializer Methods and dealloc, see [here](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmPractical.html#//apple_ref/doc/uid/TP40004447-SW6).
260261

261262
**Preferred:**
262263

@@ -299,7 +300,9 @@ Property attributes should be explicitly listed, and will help new programmers w
299300

300301
## Dot-Notation Syntax
301302

302-
Dot-notation should **always** be used for accessing and mutating properties. Bracket notation is preferred in all other instances.
303+
Dot syntax is purely a convenient wrapper around accessor method calls. When you use dot syntax, the property is still accessed or changed using getter and setter methods. Read more [here](https://developer.apple.com/library/ios/documentation/cocoa/conceptual/ProgrammingWithObjectiveC/EncapsulatingData/EncapsulatingData.html)
304+
305+
Dot-notation should **always** be used for accessing and mutating properties, as it makes code more concise. Bracket notation is preferred in all other instances.
303306

304307
**Preferred:**
305308
```objc
@@ -637,16 +640,6 @@ if (error) {
637640

638641
Some of Apple’s APIs write garbage values to the error parameter (if non-NULL) in successful cases, so switching on the error can cause false negatives (and subsequently crash).
639642

640-
## Image Naming
641-
642-
Image names should be named consistently to preserve organization and developer sanity. They should be named as one camel case string with a description of their purpose, followed by the un-prefixed name of the class or property they are customizing (if there is one), followed by a further description of color and/or placement, and finally their state.
643-
644-
**Preferred:**
645-
646-
* `RefreshBarButtonItem` / `RefreshBarButtonItem@2x` and `RefreshBarButtonItemSelected` / `RefreshBarButtonItemSelected@2x`
647-
* `ArticleNavigationBarWhite` / `ArticleNavigationBarWhite@2x` and `ArticleNavigationBarBlackSelected` / `ArticleNavigationBarBlackSelected@2x`.
648-
649-
If asset catalogs are not used, images that are used for a similar purpose should be grouped in respective groups in an Images folder.
650643

651644
## Singletons
652645

0 commit comments

Comments
 (0)