I have a UITextView
that will have a mixture of images (as NSTextAttachment
) and character strings. The UITextView
is NOT selectable, so I can use:
- (BOOL)textView:(UITextView *)textView shouldInteractWithTextAttachment:(NSTextAttachment *)textAttachment inRange:(NSRange)characterRange
How do I delete the textAttachment
in the method?
NSMutableAttributedString *mutableAttr = [[textView attributedText] mutableCopy]; [mutableAttr replaceCharactersInRange:range withString:@""]; [textView setAttributedText:mutableAttr];
? – Larme