0
Comment insérer un NSTextAttachment
à un emplacement spécifique dans un NSAttributedString
?Comment insérer NSTextAttachment dans NSAttributedString?
Comment insérer un NSTextAttachment
à un emplacement spécifique dans un NSAttributedString
?Comment insérer NSTextAttachment dans NSAttributedString?
let attributedString = NSAttributedString(attachment: textAttachment)
let mutableAttributedText = NSMutableAttributedString(attributedString: textView.attributedText)
mutableAttributedText.replaceCharacters(in: selectedRange, with: attributedString)
textView.attributedText = mutableAttributedText