Last active
July 9, 2017 13:55
-
-
Save yoxisem544/4f946684fec68cca285bf608840edcfb 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
final public class Singleton { | |
public class func instance() -> Singleton { | |
struct Static { | |
static let instance: Singleton = Singleton() | |
} | |
return Static.instance | |
} | |
// Hide initializer | |
private init() { } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment