Latest | 0.1.1 |
---|---|
Homepage | https://github.com/Clinkle/CLKSingletons |
License | MIT |
Platforms | ios 7.0, requires ARC |
Authors |
CLKSingletons provides an elegant macro for declaring singletons in your iOS app. It’s thread-safe and requires no boilerplate
It also provide tools to manage all of your singleton instances collectively, including KVOing on their properties and destroying them individually or all together.
For example:
@interface ContactBook : NSObject
DECLARE_SINGLETON_FOR_CLASS(ContactBook)
@end
@implementation ContactBook
SYNTHESIZE_SINGLETON_FOR_CLASS(ContactBook)
@end
Now ContactBook
can be instantiated at most once. Reference it as [ContactBook singleton]
(or pass your own accessor, e.g. sharedInstance
, as a second argument to the macros). You can also call [ContactBook destroy]
to kill the current instance or [ContactBook hasBeenCreated]
to see whether it exists yet.
Installation
Add pod 'CLKSingletons'
to your Podfile
or download the source here
Latest podspec
{ "name": "CLKSingletons", "version": "0.1.1", "summary": "CLKSingletons provides an elegant macro for declaring singletons in your iOS app.", "homepage": "https://github.com/Clinkle/CLKSingletons", "license": "MIT", "authors": { "tsheaff": "[email protected]" }, "source": { "git": "https://github.com/Clinkle/CLKSingletons.git", "tag": "0.1.1" }, "platforms": { "ios": "7.0" }, "requires_arc": true, "source_files": "Pod/Classes" }
Wed, 02 Mar 2016 10:51:03 +0000