Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return tableStructure.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cellType = tableStructure[indexPath.row]
let cell = cellType.generator.cell(for: indexPath, inTableView: tableView)
cellType.generator.configure(cell: cell, using: cellType.associatedObject, at: indexPath)
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return tableStructure[indexPath.row].cellHeight
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment