Skip to content

Instantly share code, notes, and snippets.

@rockname
Created December 3, 2018 09:00
Show Gist options
  • Select an option

  • Save rockname/36600e008d051e308424317e3aed1ec1 to your computer and use it in GitHub Desktop.

Select an option

Save rockname/36600e008d051e308424317e3aed1ec1 to your computer and use it in GitHub Desktop.
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let (value, reusableId) = self.values[indexPath.section].rows[indexPath.row]
let cell = tableView.dequeueReusableCell(withIdentifier: reusableId, for: indexPath)
switch (cell, value) {
case (_ as ProfileTableViewCell, _ as Void): break
case let (cell as TaskTableViewCell, value as Task):
cell.configure(with: value)
default: break
}
return cell
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment