I want to highlight some cells in my tableView. By highlighting I mean setting the background color of the cell to the blue color used for example when copying a text. I used tried this code to check if it works
public func tableView(_ tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
cell.setHighlighted(true, animated: false)
}
I also tried this
cell.setSelected(true, animated: false)
In both cases the cells become grey and not blue. Is there a solution for that?