Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix attributedText messageLabelFont bug #412

Merged
merged 2 commits into from
Dec 18, 2017
Merged

Conversation

SD10
Copy link
Member

@SD10 SD10 commented Dec 18, 2017

This resolves a bug when sending a new message using .attributedText(NSAttributedString).

This is caused by MessagesCollectionView calling the TextMessageCell's method configure(with:at:and) which sets the attributedText for MessageLabel.

However, afterwards apply(_ layoutAttributes: UICollectionViewLayoutAttributes) is called which then results in overwriting the .font in the attributedText by settings messageLabel.font to MessageCollectionViewLayoutAttributes.messageLabelFont.

Therefore, my solution is to extract the font inside of the MessagesCollectionViewFlowLayout object.

@SD10 SD10 merged commit 95199c9 into development Dec 18, 2017
@SD10 SD10 deleted the bugfix/attributed-font branch December 18, 2017 03:30
@SD10 SD10 mentioned this pull request Dec 18, 2017
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant