Hello
I'm using PHAsset in PhotoKit and getting UIImage from requestImage() in my project.
I saw SwiftyGif just supports from data or url to image. So I use this code like below.
guard let image = data.object as? UIImage else { return }
if let data = image.pngData() {
do {
let image = try UIImage(gifData: data)
} catch let error {
print(error.localizedDescription)
}
}
data.object is NSObject(actually UIImage in that code) from requestImage() and I use pngData() to ready to use SwiftyGif.
But I got error log like Invalid gif file.
What did I miss?
Is there a better solution to use it with photokit?
Hello I'm using
PHAsset
in PhotoKit and getting UIImage fromrequestImage()
in my project. I saw SwiftyGif just supports from data or url to image. So I use this code like below.data.object
isNSObject
(actuallyUIImage
in that code) fromrequestImage()
and I usepngData()
to ready to use SwiftyGif. But I got error log likeInvalid gif file
.What did I miss? Is there a better solution to use it with photokit?