Created
January 2, 2018 14:59
-
-
Save joelmarquez90/def824331ab20435b8f68b306b68fa4e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// 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