Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

added gif into NSTextAttachment, but not animated #95

Open
fukemy opened this issue Jun 11, 2020 · 0 comments
Open

added gif into NSTextAttachment, but not animated #95

fukemy opened this issue Jun 11, 2020 · 0 comments

Comments

@fukemy
Copy link

fukemy commented Jun 11, 2020

hi, i loaded success gif image into my attribute string, but it can not animate, it's hard to me to know the problem

let attachment = NSTextAttachment()
                                    attachment.image = UIImage.gif(url: getEmojiUrl(name: data.Data))
                                    attachment.bounds = CGRect(x: 0, y: ((UIFont.systemFont(ofSize: 16).capHeight) - 28).rounded() / 2, width: 28, height: 28)
                                    let replacement = NSAttributedString(attachment: attachment)
                                    attributedString.replaceCharacters(in: aMatch.range, with: replacement)

Screen Shot 2020-06-11 at 15 22 08

this is sample link i loaded https://devlink.vedax.ai/images/emotions/cry.gif

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant