mirror of
https://github.com/MessageKit/MessageKit.git
synced 2026-02-06 19:03:19 +00:00
Only apply textColor for .text case of MessageData (#625)
* Only apply textColor for .text case of MessageData * Update CHANGELOG * Add name and PR #
This commit is contained in:
@@ -90,6 +90,9 @@ You must now set this font explicitly through the `emojiMessageSizeCalculator` o
|
||||
- Changed the `contentMode` of the `UIImageView` for `MediaMessageCell` to be `.scaleAspectFill`.
|
||||
[#587](https://github.com/MessageKit/MessageKit/pull/587) by [@SD10](https://github.com/sd10).
|
||||
|
||||
- The result of the `MessagesDisplayDelegate` method `textColor(for message:...)` no longer applies to `.attributedText` case of `MessageData`.
|
||||
[#625](https://github.com/MessageKit/MessageKit/pull/625) by [@cwalo](https://github.com/cwalo).
|
||||
|
||||
### Removed
|
||||
|
||||
- **Breaking Change** Removed the `showsDateHeaderAfterTimeInterval` property of `MessagesCollectionView`.
|
||||
|
||||
@@ -89,7 +89,7 @@ public protocol MessagesDisplayDelegate: AnyObject {
|
||||
/// Specifies the color of the text for a `TextMessageCell`.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - message: A `MessageType` with a `MessageData` case of `.text` or `.attributedText` to which the color will apply.
|
||||
/// - message: A `MessageType` with a `MessageData` case of `.text` to which the color will apply.
|
||||
/// - indexPath: The `IndexPath` of the cell.
|
||||
/// - messagesCollectionView: The `MessagesCollectionView` in which this cell will be displayed.
|
||||
///
|
||||
|
||||
@@ -80,13 +80,12 @@ open class TextMessageCell: MessageContentCell {
|
||||
switch message.data {
|
||||
case .text(let text), .emoji(let text):
|
||||
messageLabel.text = text
|
||||
messageLabel.textColor = textColor
|
||||
case .attributedText(let text):
|
||||
messageLabel.attributedText = text
|
||||
default:
|
||||
break
|
||||
}
|
||||
// Needs to be set after the attributedText because it takes precedence
|
||||
messageLabel.textColor = textColor
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user