Last active
February 8, 2020 00:20
-
-
Save pranjalsatija/938857af442a4c91a87c449c74e23612 to your computer and use it in GitHub Desktop.
A small example showing off how to use UITableViewDescriptor.
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( | |
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