Created
September 11, 2015 14:04
-
-
Save licvido/56be5108cf96506f2241 to your computer and use it in GitHub Desktop.
SWIFT: Singleton
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 DeathStarSuperlaser { | |
static let sharedInstance = DeathStarSuperlaser() | |
private init() { | |
// Private initialization to ensure just one instance is created. | |
} | |
} | |
let laser = DeathStarSuperlaser.sharedInstance |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment