Skip to content

Instantly share code, notes, and snippets.

@pranjalsatija
Last active February 8, 2020 00:20
Show Gist options
  • Save pranjalsatija/938857af442a4c91a87c449c74e23612 to your computer and use it in GitHub Desktop.
Save pranjalsatija/938857af442a4c91a87c449c74e23612 to your computer and use it in GitHub Desktop.
A small example showing off how to use UITableViewDescriptor.
tableView.descriptor = UITableViewDescriptor(sections: [
UITableViewSection(
data: $data, // data: [Int], $data: Publisher<Int, Never>
cellProvider: {(tableView, indexPath, element) in
let cell = tableView.dequeueReusableCell(withIdentifier: "cell") as! Cell
cell.titleLabel.text = "Item #\(element)"
return cell
}
)
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment