Aleksandar Djuric Aleksandar Djuric - 24 days ago 11
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

Did you set delegate for your tableView?

Comments