I'm trying to bind(to:) a collectionView, but the tableView doesn't work either. I have a viewModel where is my Variable<[]> and I want to subscribe when the value changes, with my tableView.
viewModel.theVariable
.asObservable()
.bind(to: tableView.rx.items(cellIdentifier: "Cell", cellType: UITableViewCell.self)){
(row, item, cell) in
cell.textLabel?.text = item
}
.addDisposableTo(disposeBag)
The XCode tells me Type 'inout UITableView' does not conform to protocol 'ReactiveCompatible'
which should be since it's applicable to any UIView.
I've tried Observable with it's just() and that approach seemed to work correctly. The thing is that I need to have a Variable which I set a value in the viewModel and in the View i need to observe this change. Not sure if Observable serves this method.
The point is that this should work even with Variable? Is it a bug? Im using Swift 3.2
Here is a working code example :