In my rich text project I use NSTextAttachment to add an image, but the image is blurred.How to solve this problem? Thanks a lot.
Code Block if let image = UIImage(named: "tag") { let textAttachment = NSTextAttachment() textAttachment.image = image textAttachment.bounds = CGRect(origin: CGPoint.zero, size: image.size) let textAttachmentString = NSMutableAttributedString(attributedString: NSAttributedString(attachment: textAttachment)) textAttachmentString.addAttribute(NSAttributedString.Key.paragraphStyle, value: paraph, range: NSRange(location: 0, length: textAttachmentString.length)) attributedText.append(textAttachmentString) }