2017-04-13 50 views

回答

0
let attributedString = NSAttributedString(attachment: textAttachment) 
let mutableAttributedText = NSMutableAttributedString(attributedString: textView.attributedText) 
mutableAttributedText.replaceCharacters(in: selectedRange, with: attributedString) 
textView.attributedText = mutableAttributedText