adjuric
adjuric

Reputation: 280

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

}

Upvotes: 0

Views: 28

Answers (1)

Artem
Artem

Reputation: 401

Did you set delegate for your tableView?

Upvotes: 1

Related Questions