Skip to content

Instantly share code, notes, and snippets.

@ArchieR7
Last active May 4, 2017 06:21
Show Gist options
  • Save ArchieR7/d83137b77ab03fd2847d9a16b8056486 to your computer and use it in GitHub Desktop.
Save ArchieR7/d83137b77ab03fd2847d9a16b8056486 to your computer and use it in GitHub Desktop.
#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