Skip to content

Instantly share code, notes, and snippets.

@Kureev
Created October 20, 2016 08:14
Show Gist options
  • Save Kureev/af3fd6784bda376c4990f125a08184d8 to your computer and use it in GitHub Desktop.
Save Kureev/af3fd6784bda376c4990f125a08184d8 to your computer and use it in GitHub Desktop.
#import <Foundation/Foundation.h>
@interface EBUIManager : NSObject
+ (instancetype)sharedInstance;
- (void)addValue:(id)value forKey:(NSString *)key;
@end
#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment