Open
Description
I am a stranger to RxDataSources,when I set the datasource to UICollectionView, got the error:
Instance method 'items(dataSource:)' requires that 'CollectionViewSectionedDataSource<NoticeList>' conform to 'RxCollectionViewDataSourceType'
code:
let dataSource = RxCollectionViewSectionedReloadDataSource<NoticeList> { (dataSource, collectionView, indexPath, model) -> UICollectionViewCell in
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell",
for: indexPath) as! ListCollectionViewCell
cell.titleLabel.text = model.title
cell.numberLabel.text = String(indexPath.row)
return cell
}
...
NoticeListViewModel().data.asDriver(onErrorJustReturn: []).drive(collectionView.rx.items(dataSource: dataSource)).disposed(by:disposeBag)
Metadata
Metadata
Assignees
Labels
No labels