Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Singleton {
- static var instance: Singleton?
- static var shareInstance: Singleton {
- if let instance = instance {
- return instance
- }
- let newInstance = Singleton()
- instance = newInstance
- return newInstance
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement