Created
June 20, 2018 16:21
-
-
Save tilltue/5dcfdb35cef749cd4ce2190cd09aec61 to your computer and use it in GitHub Desktop.
Currency Selected ViewController
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension CurrencySelectedViewController { | |
func bindViewModel() { | |
self.viewModel.listOfCurrencyDatasource.bind(to: self.bindProperty.bindViewModels).disposed(by: disposeBag) | |
self.viewModel.databaseModelObservable.bind(to: self.viewModel.currencyCellViewModels).disposed(by: disposeBag) | |
self.bindDataSource(tableView: self.tableView) | |
//UI action | |
self.bindProperty.selectedCell.asObservable().map{ $0.1 }.subscribe(onNext: { [weak self] cellViewModel in | |
self?.viewModel.selected(cellViewModel: cellViewModel) | |
self?.view.generateFeedBack() | |
DispatchQueue.main.async { | |
self?.viewModel.cancel() | |
} | |
}).disposed(by: disposeBag) | |
self.cancelButton.rx.throttleTap.subscribe(onNext: { [weak self] _ in | |
self?.viewModel.cancel() | |
}).disposed(by: disposeBag) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment