Last active
May 4, 2017 06:21
-
-
Save ArchieR7/d83137b77ab03fd2847d9a16b8056486 to your computer and use it in GitHub Desktop.
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
#import "SingletonDemo.h" | |
@implementation SingletonDemo | |
+ (instancetype)shared { | |
static ArchieSingleton *instance = nil; | |
static dispatch_once_t once_token; | |
dispatch_once(&once_token, ^{ | |
instance = [[ArchieSingleton alloc] init]; | |
}); | |
return instance; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment