mirror of
https://github.com/ReactiveX/RxSwift.git
synced 2024-10-05 06:27:29 +03:00
Update UITableView+Rx.swift comment
- Edit comment because configureCell was changed to required init
This commit is contained in:
parent
67f44b4884
commit
74db9d13e0
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user