Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Example/Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ class ViewController: UIViewController {
switch demo {
case .plain:
// A plain list with a single section -> Publisher<[Person], Never>
first.publisher
let plainSubject = PassthroughSubject<[Person], Never>()
plainSubject.eraseToAnyPublisher()
.bind(subscriber: tableView.rowsSubscriber(cellIdentifier: "Cell", cellType: PersonCell.self, cellConfig: { cell, indexPath, model in
cell.nameLabel.text = "\(indexPath.section+1).\(indexPath.row+1) \(model.name)"
}))
.store(in: &subscriptions)
plainSubject.send(first.first!)

case .multiple:
// Table with sections -> Publisher<[[Person]], Never>
Expand Down