UITextField
have very bad performance on drawing image attachments while scrolling on iPhone 6+/6s+. I am working on some subviews solution to overlap attachments with UIImageView
s. It works well, but I need UITextView
to stop drawing this attachments but keep attachment frames on their places.
I know about NSTextContainer
exclusionPaths
property, but not sure it will works well for async image loading. Image sizes will be known after downloading.
Found working solution by nilling [NSTextAttachment image]
and restoring bounds:
CGRect bounds = attachment.bounds;
attachment.image = nil;
attachment.bounds = bounds;