Guest User

Untitled

a guest
May 25th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. class RealmTodoManager: TodoProvider { ... }
  2.  
  3. class FirebaseTodoManager: TodoProvider { ... }
  4.  
  5. extension AppDelegate: UIApplicationDelegate {
  6.  
  7. func application(
  8. _ application: UIApplication,
  9. didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?
  10. )
  11. -> Bool {
  12.  
  13. ....
  14.  
  15. // Use the database as the provider.
  16. todoListViewController.todoProvider = RealmTodoManager()
  17.  
  18. // Use the cahce as the provider.
  19. todoListViewController.todoProvider = FirebaseTodoManager()
  20.  
  21. ...
  22.  
  23. }
  24.  
  25. }
Add Comment
Please, Sign In to add comment