Last active
February 25, 2016 02:28
-
-
Save mikekavouras/61ad0483f43b68c61887 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
| func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell{ | |
| guard let cell = tableView.dequeueReusableCellWithIdentifier("roundsIdentifier", forIndexPath:indexPath) as? CustomRoundsTableViewCell else { | |
| return UITableViewCell() | |
| } | |
| let round = roundsArray[indexPath.row] | |
| cell.roundNumberLabel?.text = "Round \(round.value)" | |
| cell.redScoreLabel?.text = String(round.redScore) | |
| cell.blueScoreLabel?.text = String(round.blueScore) | |
| let hasScore = round.redScore != 0 && round.blueScore != 0 | |
| cell.selectionStyle = hasScore ? .None : .Default | |
| cell.userInteractionEnabled = !hasScore | |
| cell.roundNumberLabel.enabled = !hasScore | |
| cell.blueScoreLabel.enabled = !hasScore | |
| cell.redScoreLabel.enabled = !hasScore | |
| return cell | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment