mirror of
https://github.com/MessageKit/MessageKit.git
synced 2026-02-06 19:03:19 +00:00
Conform protocol
This commit is contained in:
@@ -187,6 +187,19 @@ final class AutocompleteExampleViewController: 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])
|
||||
}
|
||||
|
||||
// Async autocomplete requires the manager to reload
|
||||
func inputBar(_ inputBar: InputBarAccessoryView, textViewTextDidChangeTo text: String) {
|
||||
guard autocompleteManager.currentSession != nil, autocompleteManager.currentSession?.prefix == "#" else { return }
|
||||
|
||||
Reference in New Issue
Block a user