Skip to content

Instantly share code, notes, and snippets.



Last active Feb 24, 2017
What would you like to do?
@implementation Singleton
+ (instancetype)sharedInstance {
static Singleton *sharedInstance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedInstance = [[Singleton alloc] init];
return sharedInstance;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment