Skip to content

Instantly share code, notes, and snippets.

@Tron5000
Last active August 29, 2015 14:04
Show Gist options
  • Select an option

  • Save Tron5000/74d3b46dcc93fe12e718 to your computer and use it in GitHub Desktop.

Select an option

Save Tron5000/74d3b46dcc93fe12e718 to your computer and use it in GitHub Desktop.
Singleton Pattern in Swift < v1.2
class Singleton {
class var sharedInstance : Singleton {
struct Static {
static let instance : Singleton = Singleton()
}
return Static.instance
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment