Aleksandar Djuric Aleksandar Djuric - 1 year ago 107
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


Answer Source

Did you set delegate for your tableView?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download