Skip to content

Instantly share code, notes, and snippets.

@pranjalsatija
Last active February 8, 2020 00:20
Show Gist options
  • Save pranjalsatija/7161f3bae787d89be4066b4f0bff4014 to your computer and use it in GitHub Desktop.
Save pranjalsatija/7161f3bae787d89be4066b4f0bff4014 to your computer and use it in GitHub Desktop.
A theoretical example of a "perfect" abstraction over UITableViewDataSource and UITableViewDelegate.
tableView.descriptor = UITableViewDescriptor(sections: [
UITableViewSection(
items: $data,
cellProvider: {(tableView, indexPath, element) in
let cell = Cell.dequeue(in: tableView)
cell.configure(with: element)
return cell
}
)
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment