-
Notifications
You must be signed in to change notification settings - Fork 158
Open
Labels
Description
Is there a way to display img tags?
I know it's a lot of work, but I need you to add the ability to show img tags!
let attachment = NSTextAttachment()
attachment.image = image
let y = (font.capHeight-size.height).rounded() / 2
attachment.bounds.origin = CGPoint(x: 0, y: y)
attachment.bounds.size = size
let imageAttribute = NSAttributedString(attachment: attachment)
let mutableString = NSMutableAttributedString(string: text)
mutableString.insert(imageAttribute, at: text.count)