colemancda / NetworkObjects

Swift backend / server framework (Pure Swift, Supports Linux)
MIT License
259 stars 29 forks source link

Singletons should use GCD #22

Closed colemancda closed 10 years ago

colemancda commented 10 years ago

Singletons in the examples should use dispatch_once_t as per

+ (instancetype)sharedInstance
{
static dispatch_once_t once;
static id sharedInstance;

dispatch_once(&once, ^
{
    sharedInstance = [self new];
});

return sharedInstance;
}