0
如何在NSAttributedString
的特定位置插入NSTextAttachment
?如何將NSTextAttachment插入到NSAttributedString中?
如何在NSAttributedString
的特定位置插入NSTextAttachment
?如何將NSTextAttachment插入到NSAttributedString中?
let attributedString = NSAttributedString(attachment: textAttachment)
let mutableAttributedText = NSMutableAttributedString(attributedString: textView.attributedText)
mutableAttributedText.replaceCharacters(in: selectedRange, with: attributedString)
textView.attributedText = mutableAttributedText