美文网首页
UITextView在粘贴操作 ,出现崩溃-[_UITextKi

UITextView在粘贴操作 ,出现崩溃-[_UITextKi

作者: wodeph | 来源:发表于2023-04-26 11:43 被阅读0次

实现代理

textView.pasteDelegate = self;

- (UITextRange *)textPasteConfigurationSupporting:(id<UITextPasteConfigurationSupporting>)textPasteConfigurationSupporting

                   performPasteOfAttributedString:(NSAttributedString*)attributedString

                                          toRange:(UITextRange*)textRangeAPI_AVAILABLE(ios(11.0)){

    if([textPasteConfigurationSupportingisKindOfClass:[UITextViewclass]]) {

        [(UITextView*)textPasteConfigurationSupportingreplaceRange:textRangewithText:attributedString.string];

    }

    returntextRange;

}

相关文章

网友评论

      本文标题:UITextView在粘贴操作 ,出现崩溃-[_UITextKi

      本文链接:https://www.haomeiwen.com/subject/oofmjdtx.html