Latest 0.0.4
Homepage https://github.com/zhukov-ever/ZHNBaseSingleton
License MIT
Platforms ios 7.0, requires ARC
Frameworks Foundation
Authors

ZHNSingleton

Singleton with one line implementation.

Podfile

platform :ios, '7.0'
pod "ZHNSingleton"

Usage

1. Inherit your class from ZHNSingleton:

.h file:

@interface ChildSingleton : ZHNSingleton

@end

2. Override shared function:

.m file:

@implementation ChildSingleton
+ (instancetype)shared
{
    return [ChildSingleton sharedByClass:[ChildSingleton class]];
}
@end

3. Get your instance with shared method:

NSLog(@"%@", [ChildSingleton shared]);

4. Destroy singleton if needed:

[[ChildSingleton shared] destroy];

Latest podspec

{
    "name": "ZHNBaseSingleton",
    "version": "0.0.4",
    "summary": "Singleton with simple implementation.",
    "homepage": "https://github.com/zhukov-ever/ZHNBaseSingleton",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Zhn": "[email protected]"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/zhukov-ever/ZHNBaseSingleton.git",
        "tag": "0.0.4"
    },
    "source_files": [
        "Classes",
        "Classes/**/*.{h,m}"
    ],
    "public_header_files": "Classes/**/*.h",
    "frameworks": "Foundation",
    "requires_arc": true,
    "deprecated_in_favor_of": "ZHNSingleton"
}

Pin It on Pinterest

Share This