Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to check the message was read by receiver user or not? #80

Open
StellarKuldeep opened this issue Aug 30, 2019 · 0 comments
Open

How to check the message was read by receiver user or not? #80

StellarKuldeep opened this issue Aug 30, 2019 · 0 comments

Comments

@StellarKuldeep
Copy link

I want to check the receiver read the sender message or not and as per that I want to show/hide some content in my messageCell.

I found that current code finds the conversation was read or not by below code but I'm unable to find the code that will identify that particular message was read/unread in conversation

guard let id = conversation.userIDs.filter({$0 != userID}).first else { return }
        let isRead = conversation.isRead[userID] ?? true
        if !isRead {
            nameLabel.font = nameLabel.font.bold
            messageLabel.font = messageLabel.font.bold
            messageLabel.textColor = ThemeService.purpleColor
            timeLabel.font = timeLabel.font.bold
            
            vwNewMessage.isHidden = false
            constraintHeightOfNewMessage.constant = 24.0
            constraintTrailingOfLatestMessage.constant = 50.0
        }
        else {
            vwNewMessage.isHidden = true
            constraintHeightOfNewMessage.constant = 0.0
            constraintTrailingOfLatestMessage.constant = 10.0
        }
}

It will be very helpful to me if you guys give me some suggestion to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant