0

如何NSTextAttachment在 中的特定位置插入NSAttributedString

4

1 回答 1

0
let attributedString = NSAttributedString(attachment: textAttachment)
let mutableAttributedText = NSMutableAttributedString(attributedString: textView.attributedText)
mutableAttributedText.replaceCharacters(in: selectedRange, with: attributedString)
textView.attributedText = mutableAttributedText
于 2017-04-13T14:46:00.803 回答