mirror of
https://github.com/MessageKit/MessageKit.git
synced 2026-02-06 19:03:19 +00:00
Conform protocol
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user