Skip to content

Instantly share code, notes, and snippets.

@joelmarquez90
Created January 2, 2018 14:59
Show Gist options
  • Save joelmarquez90/def824331ab20435b8f68b306b68fa4e to your computer and use it in GitHub Desktop.
Save joelmarquez90/def824331ab20435b8f68b306b68fa4e to your computer and use it in GitHub Desktop.
// On your UITableView setUp
tableView.register(TournamentTableViewCell.self,
forCellReuseIdentifier: TournamentTableViewCell.cellReuseIdentifier())
// On your UITableViewDataSource implementation
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: TournamentTableViewCell.cellReuseIdentifier(),
for: indexPath) as! TournamentTableViewCell
guard let tournament = tournamentAtIndexPath(indexPath: indexPath) else {
return cell
}
cell.model = tournament
return cell
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment