这是 RxSwift 中的 tableView 我无法配置数据源。RxTableViewSectionedReloadDataSource 似乎缺少参数,尽管这很奇怪,因为我遵循官方文档的完全相同的代码源
Xcode 错误 每当我按回车键自动完成关闭。关闭保持空白。
自动完成无效 我真的不知道如何解决这个问题
let dataSource = RxTableViewSectionedReloadDataSource<SectionModel>()
dataSource?.configureCell = { (ds: RxTableViewSectionedReloadDataSource<SectionOfCustomData>, tv: UITableView, ip: IndexPath, item: Article) -> NewsFeedCell in
let cell = tv.dequeueReusableCell(withIdentifier: "Cell", for: ip) as! NewsFeedCell
cell.configure(news: item)
return cell
}
dataSource?.titleForHeaderInSection = { ds, index in
return ds.sectionModels[index].header
}
let sections = [
SectionOfCustomData(header: "First section", items: self.articles),
SectionOfCustomData(header: "Second section", items: self.articles)
]
guard let dtSource = dataSource else {
return
}
Observable.just(sections)
.bind(to: …Run Code Online (Sandbox Code Playgroud)