Created
February 13, 2014 06:50
-
-
Save siberianisaev/8970931 to your computer and use it in GitHub Desktop.
Singleton snippet for Xcode 5
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
+ (<#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