3

I'm trying to add a date label to the JSQMessageViewController and im implementing the correct method, but nothing is showing up. Here is my code:

override func collectionView(collectionView: JSQMessagesCollectionView!, attributedTextForCellBottomLabelAtIndexPath indexPath: NSIndexPath!) -> NSAttributedString! {
    let message: JSQMessage = self.messages[indexPath.item]

    return JSQMessagesTimestampFormatter.sharedFormatter().attributedTimestampForDate(message.date)
}

Thanks!

1 Answers1

2

I think you might need to overridecollectionView:layout:heightForCellBottomLabelAtIndexPath: as well.

Looks like the default value would be 0.0 according to the source.

Cheng-Yu Hsu
  • 1,029
  • 7
  • 11