Created
July 25, 2013 00:54
-
-
Save mike3k/6075953 to your computer and use it in GitHub Desktop.
SharedInstance
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
+ (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