Created
September 29, 2016 15:20
-
-
Save doluvor/cfae6b9cc39c4225d93b91643139f96c to your computer and use it in GitHub Desktop.
Singleton using GCD
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 dispatch_once_t once; | |
static id instance; | |
dispatch_once(&once, ^{ | |
instance = [self new]; | |
}); | |
return instance; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment