Created
February 24, 2018 23:53
-
-
Save charlesferreira/9619f3fb51364e6fb3ed746bc475f468 to your computer and use it in GitHub Desktop.
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
class MySingleton { | |
static func sharedInstance() -> MySingleton { | |
struct Static { | |
static let instance = MySingleton() | |
} | |
return Static.instance | |
} | |
private init() {} | |
} | |
let singleton = MySingleton.sharedInstance() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment