Skip to content

Instantly share code, notes, and snippets.

@licvido
Created September 11, 2015 14:04
Show Gist options
  • Save licvido/56be5108cf96506f2241 to your computer and use it in GitHub Desktop.
Save licvido/56be5108cf96506f2241 to your computer and use it in GitHub Desktop.
SWIFT: Singleton
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