You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func stringWithImage() -> NSAttributedString {
let font = UIFont(name: "HelveticaNeue-BoldItalic", size: 12)!
let b = Attrs().font(font).underlineStyle(.single)
let img = TagTuner(style: {
let style = Attrs()
if let imageId = $0.tag.attributes["id"] {
let textAttachment = NSTextAttachment()
textAttachment.image = UIImage(named: imageId)
style.attachment(textAttachment)
}
return style
}, transform: { _, part in
switch part {
case .opening:
return "\u{FFFC}"
case .closing:
return nil
case .content:
return nil
}
})
let str = "<b>Running</b> with <img id=\"scissors\"></img><img id=\"scissors\"/></img id=\"scissors\">!"
.style(tags: ["b": b, "img": img])
.attributedString
return str
}
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!
The text was updated successfully, but these errors were encountered: