Created
January 7, 2018 05:31
-
-
Save aratkevich/42314945b218ceab21b853136051532a to your computer and use it in GitHub Desktop.
Lazy singleton
This file contains 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
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