答案 0 :(得分:0)
您必须创建一个json解析器并为每个图像创建一个NSTextAttachment
:
let textAttachment = NSTextAttachment()
textAttachment.image = yourImage
let attrStringWithImage = NSAttributedString.init(attachment: textAttachment)
attributedString.replaceCharactersInRange(NSMakeRange(6, 1), withAttributedString: attrStringWithImage)
textView.attributedText = attributedString