diff --git a/Example/ChatExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example/ChatExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/Example/ChatExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Example/ChatExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example/ChatExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/Example/ChatExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/MessageKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/MessageKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/MessageKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Sources/Views/Cells/TextMessageCell.swift b/Sources/Views/Cells/TextMessageCell.swift index 242d713e..7ecd6352 100644 --- a/Sources/Views/Cells/TextMessageCell.swift +++ b/Sources/Views/Cells/TextMessageCell.swift @@ -44,7 +44,7 @@ open class TextMessageCell: MessageCollectionViewCell { super.apply(layoutAttributes) if let attributes = layoutAttributes as? MessagesCollectionViewLayoutAttributes { messageLabel.textInsets = attributes.messageLabelInsets - messageLabel.font = attributes.messageLabelFont + messageLabel.messageLabelFont = attributes.messageLabelFont messageLabel.frame = messageContainerView.bounds } } @@ -79,6 +79,7 @@ open class TextMessageCell: MessageCollectionViewCell { switch message.data { case .text(let text), .emoji(let text): messageLabel.text = text + messageLabel.applyMessageLableFont() case .attributedText(let text): messageLabel.attributedText = text default: diff --git a/Sources/Views/MessageLabel.swift b/Sources/Views/MessageLabel.swift index c33a20be..ff4afc01 100644 --- a/Sources/Views/MessageLabel.swift +++ b/Sources/Views/MessageLabel.swift @@ -112,6 +112,8 @@ open class MessageLabel: UILabel { if !isConfiguring { setNeedsDisplay() } } } + + internal var messageLabelFont: UIFont? private var attributesNeedUpdate = false @@ -189,6 +191,11 @@ open class MessageLabel: UILabel { } // MARK: - Private Methods + + internal func applyMessageLableFont() { + guard let font = messageLabelFont else { return } + self.font = font + } private func setTextStorage(_ newText: NSAttributedString?, shouldParse: Bool) {