Last active
February 8, 2020 00:20
-
-
Save pranjalsatija/7161f3bae787d89be4066b4f0bff4014 to your computer and use it in GitHub Desktop.
A theoretical example of a "perfect" abstraction over UITableViewDataSource and UITableViewDelegate.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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