Last active
December 15, 2015 22:19
-
-
Save blinker13/5332224 to your computer and use it in GitHub Desktop.
Class method for creating and retrieving a unique instance.
This file contains hidden or 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 dispatch_once_t onceToken; | |
| static id sharedInstance; | |
| dispatch_once(&onceToken, ^{ | |
| sharedInstance = [[self alloc] init]; | |
| }); | |
| return sharedInstance; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment