Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

不能和 RxSwift 一起使用 #34

Open
ghost opened this issue May 2, 2018 · 1 comment
Open

不能和 RxSwift 一起使用 #34

ghost opened this issue May 2, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented May 2, 2018

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)

如何解决?

@evan-cai
Copy link

我也遇到一样的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant