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
This commit is contained in:
@@ -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