Last active
August 29, 2015 14:24
-
-
Save PaulChana/4af67d0d5e0170c533cb to your computer and use it in GitHub Desktop.
Static variable init
This file contains hidden or 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
+ (NSColor *) staticColour { | |
__strong static NSColor* _sharedInstance = nil; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
_sharedInstance = [NSColor colorWithCalibratedRed:255.f green:255.f blue:255.f alpha:1.0]; | |
}); | |
return _sharedInstance; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment