SwiftGif icon indicating copy to clipboard operation
SwiftGif copied to clipboard

added gif into NSTextAttachment, but not animated

Open fukemy opened this issue 4 years ago • 0 comments

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

fukemy avatar Jun 11 '20 08:06 fukemy