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:
Corey Walo
2018-04-05 21:27:01 -05:00
committed by Wu Zhong
parent 1ea6f7aafc
commit 6fcd2d6aa2
3 changed files with 5 additions and 3 deletions
+3
View File
@@ -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.
///
+1 -2
View File
@@ -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
}
}