NSTextAttachment Animation

Is it possible to animate a NSTextAttachmentin UITextView?

I tried to change its borders, but it seems that it had no 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 it not possible with NSTextAttachmentwhat would you propose to do to achieve a similar effect?

+4
source share

Source: https://habr.com/ru/post/1525822/


All Articles