Animate NSTextAttachment
-
08-10-2022 - |
Question
Is it possible to animate a NSTextAttachment
in a UITextView
?
I tried modifying its bounds but it doesn't seem to produce any effect.
NSAttributedString *attributedText = self.textView.attributedText;
NSTextAttachment *textAttachment = [attributedText attribute:NSAttachmentAttributeName atIndex:index effectiveRange:nil];
textAttachment.bounds = CGRectMake(0, 0, 1, 1);
[UIView animateWithDuration:1 animations:^{
textAttachment.bounds = CGRectMake(50, 50, 200, 200);
}];
Is this is not possible with NSTextAttachment
, what would you suggest doing to achieve a similar effect?
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow