Skip to content

Instantly share code, notes, and snippets.

@mike3k
Created July 25, 2013 00:54
Show Gist options
  • Save mike3k/6075953 to your computer and use it in GitHub Desktop.
Save mike3k/6075953 to your computer and use it in GitHub Desktop.
SharedInstance
+ (instancetype)sharedInstance {
static SingletonClass *shared = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
shared = [[[self class] alloc] init];
});
return shared;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment