diff --git a/RxCocoa/iOS/UITableView+Rx.swift b/RxCocoa/iOS/UITableView+Rx.swift index b966129b..1f1788b6 100644 --- a/RxCocoa/iOS/UITableView+Rx.swift +++ b/RxCocoa/iOS/UITableView+Rx.swift @@ -110,7 +110,12 @@ extension Reactive where Base: UITableView { Example - let dataSource = RxTableViewSectionedReloadDataSource>() + let dataSource = RxTableViewSectionedReloadDataSource>( + 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)