Aleksandar Djuric Aleksandar Djuric - 5 months ago 36
Swift Question

How do you make a messageRead indicator by changing a UIView when a row is selected?

I'm building a messaging app and trying to create a messageRead indicator similar to the blue dot in iMessage. When the user selects a row, I set the UIView.background to clear. However, the cell doesn't update upon returning from the detail view. I feel like I missing something obvious, but can't figure it out.

override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {

let cell = tableView.cellForRow(at: indexPath) as! MessagePreviewCell
cell.customView.backgroundColor = UIColor.clear



Did you set delegate for your tableView?