Created
October 20, 2016 08:14
-
-
Save Kureev/af3fd6784bda376c4990f125a08184d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@interface EBUIManager : NSObject | |
+ (instancetype)sharedInstance; | |
- (void)addValue:(id)value forKey:(NSString *)key; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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