Last active
March 22, 2017 03:27
-
-
Save Tron5000/2bd9965aa3a0346695c6 to your computer and use it in GitHub Desktop.
Singleton Pattern in Swift >= v1.2
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
| // Swift 1.2 introduced support for static properties. | |
| class Singleton { | |
| static let shared = Singleton() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment