diff --git a/CHANGELOG.md b/CHANGELOG.md index 3309bfb1..18dfeca6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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`. diff --git a/Sources/Protocols/MessagesDisplayDelegate.swift b/Sources/Protocols/MessagesDisplayDelegate.swift index 9cea97fd..288b1cda 100644 --- a/Sources/Protocols/MessagesDisplayDelegate.swift +++ b/Sources/Protocols/MessagesDisplayDelegate.swift @@ -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. /// diff --git a/Sources/Views/Cells/TextMessageCell.swift b/Sources/Views/Cells/TextMessageCell.swift index 2ae74e56..530dcb3f 100644 --- a/Sources/Views/Cells/TextMessageCell.swift +++ b/Sources/Views/Cells/TextMessageCell.swift @@ -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 } }