Update UITableView+Rx.swift comment

- Edit comment because configureCell was changed to required init
This commit is contained in:
홍성호 2018-08-25 02:51:35 +09:00 committed by Krunoslav Zaher
parent 67f44b4884
commit 74db9d13e0

View File

@ -110,7 +110,12 @@ extension Reactive where Base: UITableView {
Example
let dataSource = RxTableViewSectionedReloadDataSource<SectionModel<String, Double>>()
let dataSource = RxTableViewSectionedReloadDataSource<SectionModel<String, Double>>(
configureCell: { dataSource, tableView, indexPath, element in
let cell = tv.dequeueReusableCell(withIdentifier: "Cell")!
cell.textLabel?.text = "\(element) @ row \(indexPath.row)"
return cell
})
let items = Observable.just([
SectionModel(model: "First section", items: [
@ -130,12 +135,6 @@ extension Reactive where Base: UITableView {
])
])
dataSource.configureCell = { (dataSource, tv, indexPath, element) in
let cell = tv.dequeueReusableCell(withIdentifier: "Cell")!
cell.textLabel?.text = "\(element) @ row \(indexPath.row)"
return cell
}
items
.bind(to: tableView.rx.items(dataSource: dataSource))
.disposed(by: disposeBag)