Skip to content

Instantly share code, notes, and snippets.

@Kureev
Created October 20, 2016 08:14

Revisions

  1. Kureev created this gist Oct 20, 2016.
    8 changes: 8 additions & 0 deletions EBUIManager.h
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    #import <Foundation/Foundation.h>

    @interface EBUIManager : NSObject

    + (instancetype)sharedInstance;
    - (void)addValue:(id)value forKey:(NSString *)key;

    @end
    22 changes: 22 additions & 0 deletions EBUIManager.m
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    #import "EBUIManager.h"

    @implementation EBUIManager

    NSMutableDictionary *registry;

    + (instancetype)sharedInstance {
    static EBUIManager *sharedInstance = nil;
    @synchronized (self) {
    if (!sharedInstance) {
    sharedInstance = [[self alloc] init];
    registry = [NSMutableDictionary new];
    }
    }
    return sharedInstance;
    }

    - (void)addValue:(id)value forKey:(NSString *)key {
    [registry setValue:value forKey:key];
    }

    @end