Last active
August 29, 2015 13:57
-
-
Save riosc/9776781 to your computer and use it in GitHub Desktop.
Efective Objective C 2.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Prefer @class instead of #import as posible | |
- In headers files use @class, in implementation file use #import | |
- For protocol, separarte the protocol in other file (h) | |
2. Prefere literals instead of class methods | |
@YES, @1, @5.45f, ... | |
3. Prefer static cons instead of prepocesor # define | |
DURATION 0.3 | |
static const NSInterval duration = 0.3; this is visible in implementatio file only | |
extern NSString * const text = @"Hola"; | |
- For constants in local files prefix kName | |
- For constants Globals prefix CLASS_NAME | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment