I am trying to change the selection color of a UITableview in my didSelectRowtIndexPath.
let selectedCellColor = UIColor.init(red: 97.0/255.0, green: 196.0/255.0, blue: 185.0/255.0, alpha: 1)
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath)
{
print("tableView -> didSelectRowAtIndexPath")
let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath)
cell.contentView.backgroundColor = selectedCellColor
cell.backgroundColor = selectedCellColor
}
Unfortunately, while the selection color changes, the text gets covered/invisible when I do this.
I did some searching but it seems this is the most recommended solution for changing the selection color of a standard UITableView cell.
I also tried changing the label color thinking it might get visible but no luck.
cell.textLabel?.textColor = UIColor.whiteColor()
What is it something that I'm missing?