ios - Displaying number of unread Message of a conversation in a table View -
i want display number of unread messages of conversation in badge each cell yellow badges in picture :
thanks !
probably kind of work need effort adding 1 parameter in listing of users in message tab(as image displayed) add 1 parameter gives unread message count of particular user. whenever displaying user list using tableview @ time can check wether user contain unread messages or not if count of unread message not 0 need display count , if 0 @ time need hide unreadcountlabel.
here snippet swift 3. hope helps
func tableview(_ tableview: uitableview, cellforrowat indexpath: indexpath) -> uitableviewcell { if self.amessageuser.unreadmessage > 0{ cell.lblunreadmsgcount.ishidden = false cell.lblunreadmsgcount.text = \(self.amessageuser.unreadmessage) } else{ cell.lblunreadmsgcount.ishidden = true } }
Comments
Post a Comment