I'm trying to add a topLabel to the JSQMessageCollectionViewCell and am implementing the correct method, but nothing is showing up. Here is my code:
override func collectionView(collectionView: JSQMessagesCollectionView!, attributedTextForMessageBubbleTopLabelAtIndexPath indexPath: NSIndexPath!) -> NSAttributedString! {
let msg: JSQMessage = self.JSQmessages[indexPath.item]
if (msg.senderId != self.senderId) {
return NSAttributedString(string: "Tester")
}
else {
return NSAttributedString(string: senderDisplayName)
}
}
Additionally, I am trying to add the date label by tapping on a given message collection cell. How should I go about doing this? I am adding an NSDate as part of each JSQMessage.