简体   繁体   中英

How to use tableView's datasource (numberOfRowsInSection) wirh RxSwift?

I'm using RxSwift, RxCocoa for my app and implemented a tableView.
When It got priceData from viewModel for tableView, it showed full list of priceData.

But I want to show only 50 counts at the first time and show more when I scroll it.
Without RxSwift/RxCocoa, I used numberOfRowsInSection for paging of tableView .

But I don't know how I can use this with RxSwift

Here is my code. what should I do with my code for making to pageable tableView?

viewModel.priceData         
            .drive(tableView.rx.items(cellIdentifier: "Cell")) { (index: Int, list, cell: Cell) in
...
}.disposed(by: disposeBag)

The RxDataSources library allows you to section your data. Add it to your project and you can use sections.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM