Skip to content

Instantly share code, notes, and snippets.

@shabib87
Last active February 24, 2017 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shabib87/58b6bf9e43c0f3e9b9b6f16a814f449f to your computer and use it in GitHub Desktop.
Save shabib87/58b6bf9e43c0f3e9b9b6f16a814f449f to your computer and use it in GitHub Desktop.
@implementation Singleton
+ (instancetype)sharedInstance {
static Singleton *sharedInstance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedInstance = [[Singleton alloc] init];
});
return sharedInstance;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment