Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. class Singleton {
  2. static var instance: Singleton?
  3. static var shareInstance: Singleton {
  4. if let instance = instance {
  5. return instance
  6. }
  7. let newInstance = Singleton()
  8. instance = newInstance
  9. return newInstance
  10. }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement