You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-13Lines changed: 6 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,6 @@ Here are some of the documents from Apple that informed the style guide. If some
45
45
*[CGRect Functions](#cgrect-functions)
46
46
*[Golden Path](#golden-path)
47
47
*[Error handling](#error-handling)
48
-
*[Image Naming](#image-naming)
49
48
*[Singletons](#singletons)
50
49
*[Line Breaks](#line-breaks)
51
50
*[Smiley Face](#smiley-face)
@@ -256,7 +255,9 @@ Variables should be named as descriptively as possible. Single letter variable n
256
255
257
256
Asterisks indicating pointers belong with the variable, e.g., `NSString *text` not `NSString* text` or `NSString * text`, except in the case of constants.
258
257
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).
260
261
261
262
**Preferred:**
262
263
@@ -299,7 +300,9 @@ Property attributes should be explicitly listed, and will help new programmers w
299
300
300
301
## Dot-Notation Syntax
301
302
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.
303
306
304
307
**Preferred:**
305
308
```objc
@@ -637,16 +640,6 @@ if (error) {
637
640
638
641
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).
639
642
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.
0 commit comments