Skip to content

Instantly share code, notes, and snippets.

View yonivav's full-sized avatar

Yoni Vizel yonivav

  • TLV
View GitHub Profile
private let dataSource = RxTableViewSectionedReloadDataSource<TableViewSection>(
configureCell: { [weak self] _, table, indexPath, viewModel in
guard let cell = table.dequeueReusableCell(withIdentifier: TableViewCell.reuseIdentifier, for: indexPath) as? TableViewCell else {
return UITableViewCell()
}
cell.viewModel = viewModel
cell.disposeBag = self.disposeBag // Bad Idea, don't do that!
return cell
})
@yonivav
yonivav / badBind.swift
Created February 20, 2019 15:22
Where is the dispose action? Where?!?!
viewModel
.btnTitle
.drive(btn.rx.title(for: .normal))
_ = Observable<Int>.interval(1, scheduler: MainScheduler.instance)
.subscribe(onNext: { _ in
print("Rx Resource count \(RxSwift.Resources.total)")
})