Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. // 1
  2. import RxSwift
  3. import RxCocoa
  4.  
  5. // 2
  6. class TodoListCellViewModel {
  7. // 3
  8. private let todoBehaviorRelay: BehaviorRelay<Todo>!
  9.  
  10. // 4
  11. var titleDriver: Driver<String> {
  12. return todoBehaviorRelay
  13. .asDriver()
  14. .map { $0.title }
  15. }
  16.  
  17. // 5
  18. init(with todo: Todo) {
  19. // 6
  20. todoBehaviorRelay = BehaviorRelay<Todo>(value: todo)
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement