如果我像这样将图像添加到 UITextView 中:
NSTextAttachment *textAttachment = [[NSTextAttachment alloc] init];
textAttachment.image = image;
NSAttributedString *attrStringWithImage = [NSAttributedString attributedStringWithAttachment:textAttachment];
[myString appendAttributedString:attrStringWithImage];
self.inputTextView.attributedText = myString;
然后我如何才能通过用户点击键盘上的后退按钮来检测图像已被删除?
我会用下面的吗?
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
如果是这样,怎么做?