Conform protocol

This commit is contained in:
amir pirzad
2020-09-02 22:47:11 +04:30
parent f08cdad1f4
commit d2b87770c9
3 changed files with 40 additions and 1 deletions
@@ -279,6 +279,19 @@ final class AdvancedExampleViewController: ChatViewController {
return nil
}
override func messageTimestampLabelAttributedText(for message: MessageType, at indexPath: IndexPath) -> NSAttributedString? {
let sentDate = message.sentDate
let sentDateString = MessageKitDateFormatter.shared.string(from: sentDate)
let timeLabelFont: UIFont = .boldSystemFont(ofSize: 10)
let timeLabelColor: UIColor
if #available(iOS 13, *) {
timeLabelColor = .systemGray
} else {
timeLabelColor = .darkGray
}
return NSAttributedString(string: sentDateString, attributes: [NSAttributedString.Key.font: timeLabelFont, NSAttributedString.Key.foregroundColor: timeLabelColor])
}
}
// MARK: - MessagesDisplayDelegate