Pill View rendering, performance improvement part 2 (#1894)

* improvdement

* code improvement
This commit is contained in:
Mauro
2023-10-16 11:08:03 +02:00
committed by GitHub
parent 39e3328b02
commit d006ed1592
3 changed files with 19 additions and 10 deletions
@@ -26,7 +26,7 @@ final class MessageTextView: UITextView, PillAttachmentViewProviderDelegate {
gestureRecognizer as? UILongPressGestureRecognizer == nil
}
func invalidateTextAttachmentsDisplay(update: Bool) {
func invalidateTextAttachmentsDisplay() {
attributedText.enumerateAttribute(.attachment,
in: NSRange(location: 0, length: attributedText.length),
options: []) { value, range, _ in
@@ -34,9 +34,7 @@ final class MessageTextView: UITextView, PillAttachmentViewProviderDelegate {
return
}
self.layoutManager.invalidateDisplay(forCharacterRange: range)
if update {
updateClosure?()
}
updateClosure?()
}
}