Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 1
- import RxSwift
- import RxCocoa
- // 2
- class TodoListCellViewModel {
- // 3
- private let todoBehaviorRelay: BehaviorRelay<Todo>!
- // 4
- var titleDriver: Driver<String> {
- return todoBehaviorRelay
- .asDriver()
- .map { $0.title }
- }
- // 5
- init(with todo: Todo) {
- // 6
- todoBehaviorRelay = BehaviorRelay<Todo>(value: todo)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement