Skip to content

Instantly share code, notes, and snippets.

@siberianisaev
Created February 13, 2014 06:50
Show Gist options
  • Save siberianisaev/8970931 to your computer and use it in GitHub Desktop.
Save siberianisaev/8970931 to your computer and use it in GitHub Desktop.
Singleton snippet for Xcode 5
+ (<#Class name#> *)<#Singleton method#>
{
static <#Class name#> *sharedInstance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedInstance = [[<#Class name#> alloc] init];
});
return sharedInstance;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment