Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. import Dip
  2.  
  3. //1
  4. private let container = DependencyContainer { container in
  5.  
  6. //2
  7. container.register { SimpleClock() as Clock }
  8. }
  9.  
  10. //3
  11. let simpleClock: Clock = try! container.resolve()
  12.  
  13. /*
  14. * Output:
  15. * creating SimpleClock
  16. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement