I am trying to change the appearance of a custom selected TableViewCell using Swift.
Do I need to do it via the designer or programmatically?
I tried the fol
I have a likeness problem. In your cellForRowAtIndexPath method set:
cell.selectionStyle = .None
and then set didHighlightRowAtIndexPath...
func tableView(_ tableView: UITableView, didHighlightRowAt indexPath: IndexPath) {
let cell = tableView.cellForRow(at: indexPath)
cell!.contentView.backgroundColor = .green
}
func tableView(_ tableView: UITableView, didUnhighlightRowAt indexPath: IndexPath) {
let cell = tableView.cellForRow(at: indexPath)
cell!.contentView.backgroundColor = .clear
}