- UI响应model
self.searchBar.rx.text.orEmpty
.bind(to: self.viewModel.searchTextOB)
.disposed(by: self.disposeBag)
- model绑定到UI
self.viewModel.searchData.drive(self.tableView.rx.items){ (tb,indexPath,model) -> LGTableViewCell in
let cell = tb.dequeueReusableCell(withIdentifier: self.resuseID) as! LGTableViewCell
cell.nameLabel.text = model.name
cell.classLabel.text = model.url
cell.selectionStyle = .none
return cell
}.disposed(by: self.disposeBag)
待完善
网友评论