Show custom emoji in profile field names
This commit is contained in:
parent
722b81dad9
commit
1cd3e6adf9
|
@ -24,6 +24,8 @@ class EmojiLabel: UILabel {
|
|||
emojiRequests = []
|
||||
|
||||
let matches = emojiRegex.matches(in: attributedText.string, options: [], range: attributedText.fullRange)
|
||||
guard !matches.isEmpty else { return }
|
||||
|
||||
let emojiImages = CachedDictionary<UIImage>(name: "EmojiLabel Emoji Images")
|
||||
|
||||
let group = DispatchGroup()
|
||||
|
|
|
@ -133,13 +133,14 @@ class ProfileHeaderView: UIView {
|
|||
fieldNamesStackView.arrangedSubviews.forEach { $0.removeFromSuperview() }
|
||||
fieldValuesStackView.arrangedSubviews.forEach { $0.removeFromSuperview() }
|
||||
for field in account.fields {
|
||||
let nameLabel = UILabel()
|
||||
let nameLabel = EmojiLabel()
|
||||
nameLabel.text = field.name
|
||||
nameLabel.font = .boldSystemFont(ofSize: 17)
|
||||
nameLabel.textAlignment = .right
|
||||
nameLabel.numberOfLines = 0
|
||||
nameLabel.lineBreakMode = .byWordWrapping
|
||||
nameLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
|
||||
nameLabel.setEmojis(account.emojis, identifier: "")
|
||||
fieldNamesStackView.addArrangedSubview(nameLabel)
|
||||
|
||||
let valueTextView = ContentTextView()
|
||||
|
|
Loading…
Reference in New Issue