Skip to content

Instantly share code, notes, and snippets.

@ricobeck
Created July 19, 2013 08:19
Show Gist options
  • Save ricobeck/6037568 to your computer and use it in GitHub Desktop.
Save ricobeck/6037568 to your computer and use it in GitHub Desktop.
Shared Controller
+ (instancetype)sharedController;
+ (instancetype)sharedController
{
static <#Class#> *sharedInstance = nil;
static dispatch_once_t pred;
dispatch_once(&pred, ^{
sharedInstance = [[<#Class#> alloc] init];
});
return sharedInstance;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment