Skip to content

Instantly share code, notes, and snippets.

@thinkclay
Created November 19, 2014 20:00
Show Gist options
  • Save thinkclay/9a3a6301cd0762d09a77 to your computer and use it in GitHub Desktop.
Save thinkclay/9a3a6301cd0762d09a77 to your computer and use it in GitHub Desktop.
class SingletonClass
{
class var shared : SingletonClass
{
struct Static
{
static let instance : SingletonClass = SingletonClass()
}
​return Static.instance
}
}
let instance = SingletonClass.shared
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment