You need to delete this line
let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as! GroupTableViewCell
from your function willDisplayCell, because it already has your cell in the parameters, and you just override it with a new cell, and your new cell will never be used.
If you want to show the colors in order, you can use indexPath:
var cellColors = ["F28044","F0A761","FEC362","F0BB4C","E3CB92","FEA375"]
func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
cell.contentView.backgroundColor = UIColor(hexString: cellColors[indexPath.row % cellColors.count])
}
source
share