Skip to content

Instantly share code, notes, and snippets.

@anoop4real
Last active November 8, 2017 06:33
Show Gist options
  • Select an option

  • Save anoop4real/ce069081cb235839a09945d4694e080c to your computer and use it in GitHub Desktop.

Select an option

Save anoop4real/ce069081cb235839a09945d4694e080c to your computer and use it in GitHub Desktop.
A snippet for singleton
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