Created
January 14, 2020 17:27
-
-
Save zafarivaev/80f738fd36b1386d38014346ed8d2596 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// MARK: - Binding | |
extension HolidaysViewController { | |
func bindTableView() { | |
viewModel.holidays | |
.bind(to: tableView.rx.items(cellIdentifier: "HolidayTableViewCell", cellType: HolidayTableViewCell.self)) { index, viewModel, cell in | |
cell.viewModel = viewModel | |
} | |
.disposed(by: disposeBag) | |
tableView.rx.modelSelected(HolidayViewModel.self) | |
.bind(to: viewModel.selectedHoliday) | |
.disposed(by: disposeBag) | |
tableView.rx.itemSelected | |
.subscribe(onNext: { (indexPath) in | |
self.tableView.deselectRow(at: indexPath, animated: true) | |
}) | |
.disposed(by: disposeBag) | |
} | |
...... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment