Created
July 20, 2014 15:49
-
-
Save licvido/3ec14897b1f9fdd7df28 to your computer and use it in GitHub Desktop.
SWIFT: Shared instance
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
var APISharedInstance: API? = nil | |
class API | |
{ | |
init() | |
{ | |
APISharedInstance = self | |
} | |
class func sharedInstance() -> API | |
{ | |
return APISharedInstance! | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment