famfamfam
famfamfam

Reputation: 545

swift tablecell NSTextAttachment + GIF -> gif image not animate

im try to add gif image to table cell + text attribute, i worked on nstextattachment to show gif image normally, the gif image showed but it does not animate. did someone explain me the problem?

let attachment = NSTextAttachment()
attachment.image = UIImage.gif(name: data.Data)
attachment.bounds = CGRect(x: 0, y: (font.capHeight - gifSize).rounded() / 2, width: gifSize, height: gifSize)
let replacement = NSAttributedString(attachment: attachment)
attributedString.replaceCharacters(in: aMatch.range, with: replacement)

enter image description here

Upvotes: 0

Views: 372

Answers (1)

Anit Kumar
Anit Kumar

Reputation: 8153

Gif image will not work with NSTextAttachment. You can use UIImageView for .gif images.

Upvotes: 0

Related Questions