Skip to content

Instantly share code, notes, and snippets.

@AlexPinhasov
Created July 1, 2020 05:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexPinhasov/1943c3f6f64662222a3ea4cdc8715a54 to your computer and use it in GitHub Desktop.
Save AlexPinhasov/1943c3f6f64662222a3ea4cdc8715a54 to your computer and use it in GitHub Desktop.
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