Skip to content

Instantly share code, notes, and snippets.

@abbeyjackson
Last active May 4, 2016 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save abbeyjackson/bbaaf5ef9d17599a86e8 to your computer and use it in GitHub Desktop.
Save abbeyjackson/bbaaf5ef9d17599a86e8 to your computer and use it in GitHub Desktop.
sharedInstance singleton
+ (instancetype)sharedInstance
{
static dispatch_once_t once;
static id sharedInstance;
dispatch_once(&once, ^{
sharedInstance = [[self alloc] init];
});
return sharedInstance;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment