Last active
November 8, 2017 06:33
-
-
Save anoop4real/ce069081cb235839a09945d4694e080c to your computer and use it in GitHub Desktop.
A snippet for singleton
This file contains hidden or 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
| class <#Class#> { | |
| // Private Init | |
| private init() { } | |
| // MARK: Shared Instance | |
| private static let _shared = <#Class#> | |
| // MARK: - Accessors | |
| class func shared() -> <#Class#> { | |
| return _shared | |
| } | |
| } | |
| // Use Class.shared() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment