Created
October 20, 2014 09:59
-
-
Save exce11ent/dbf8435e52c1ef08fabf to your computer and use it in GitHub Desktop.
Swift singleton
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 WithSingleton { | |
class var sharedInstance :WithSingleton { | |
struct Singleton { | |
static let instance = WithSingleton() | |
} | |
return Singleton.instance | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment