Skip to content

Instantly share code, notes, and snippets.

@aratkevich
Created January 7, 2018 05:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aratkevich/42314945b218ceab21b853136051532a to your computer and use it in GitHub Desktop.
Save aratkevich/42314945b218ceab21b853136051532a to your computer and use it in GitHub Desktop.
Lazy singleton
static var shared: SomeManager {
guard let instance = SomeManager._shared else {
SomeManager._shared = SomeManager()
return SomeManager._shared!
}
return instance
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment