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 Singleton { | |
// singelton pattern | |
private static var privateShared : Singleton? | |
class func shared() -> Singleton { | |
// make sure we get an instance from the singleton queue | |
guard let uwShared = read(privateShared) else { | |
privateShared = Singleton() | |
return privateShared! |
OlderNewer