HGPlaceholders
HGPlaceholders copied to clipboard
不能和 RxSwift 一起使用
placeholderTableView = tableView as? TableView
placeholderTableView?.tableFooterView = UIView()
placeholderTableView?.placeholderDelegate = self
placeholderTableView?.dataSource = nil
placeholderTableView?.placeholdersProvider = .default
placeholderTableView?.showNoResultsPlaceholder()
placeholderTableView?.reloadData()
// 使用 Rx 配置 tableView 数据时崩溃,似乎是已存在 dataSource 的问题。
viewModel.data.asObservable().share().bind(to:
tableView.rx.items(cellIdentifier: "Cell")
) { (row, model, cell) in
cell.textLabel?.text = model.oper_name
}.disposed(by: viewModel.bag)
如何解决?
我也遇到一样的问题