Created
July 29, 2014 17:20
-
-
Save deezaster/3649e123c1acff18650c to your computer and use it in GitHub Desktop.
Singleton Class in Swift
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
class App | |
{ | |
class var shared : App { | |
struct Static { | |
static let instance : App = App() | |
} | |
return Static.instance | |
} | |
init() { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment