forked from mirrors/linphone-iphone
Increase size of bubble text when it's only composed of emojis
This commit is contained in:
parent
c619d61d8c
commit
67554b43f4
1 changed files with 12 additions and 0 deletions
|
|
@ -800,6 +800,18 @@ class MultilineMessageCell: UICollectionViewCell, UICollectionViewDataSource, UI
|
|||
imagesGridCollectionViewNil += 1
|
||||
}
|
||||
|
||||
if (content.utf8Text.trimmingCharacters(in: .whitespacesAndNewlines).unicodeScalars.first?.properties.isEmojiPresentation == true){
|
||||
var onlyEmojis = true
|
||||
content.utf8Text.trimmingCharacters(in: .whitespacesAndNewlines).unicodeScalars.forEach { emoji in
|
||||
if !emoji.properties.isEmojiPresentation && !emoji.properties.isWhitespace{
|
||||
onlyEmojis = false
|
||||
}
|
||||
}
|
||||
if onlyEmojis {
|
||||
label.font = label.font.withSize(51)
|
||||
}
|
||||
}
|
||||
|
||||
NSLayoutConstraint.deactivate(labelHiddenConstraints)
|
||||
label.isHidden = false
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue