- Min iOS SDK: 7.0
- Language: Swift-compatible Objective-C.
- Tests: Yes, please
- Avoid singletons that don't encapsulate a finite resource
- Never expose mutable state
- Public API designed to be called safely from any thread
- Keep classes/methods sharply focused
- Stay generic
Please add new code to this project based on the following style guidelines:
Among other things, these guidelines call for:
- Open braces on the same line; close braces on their own line
- Always using braces for
if
statements, even with single-liners - No spaces in method signatures except after the scope (-/+) and between parameter segments
- Use dot-notation, not
setXXX
, for properties (e.g.self.enabled = YES
) - Asterisk should touch variable name, not type (e.g.
NSString *myString
) - Prefer
static const
(orstatic Type *const
) over#define
for compile-time constants - Prefer private properties to ‘naked’ instance variables wherever possible
- Prefer accessor methods over direct struct access (e.g. CGGeometry methods like
CGRectGetMinX()
)
- Prefix all class names with
YM
- Prefix all constants with
kYM
- Group related methods with
#pragma mark
- Keep as much of the API private as is practically possible