Documentation says if you set your UIImageView to FLAnimatedImageView then animated gifs would be handled.
inspirationImageView.sd_setImage(with: imageUrl)
my inspirationImageView is a FLAnimatedImageView and the gifs don't play.
What am I doing wrong?
You'll need to give us more information than this. More code would be nice.
@talkaboutdesign do you have the subspec GIF in your podfile like this?:
pod 'SDWebImage/GIF'
I have the same issue. I added pod 'SDWebImage' and pod 'FLAnimatedImage' into podfile, and I changed the UIImageView to FLAnimatedImageView but nothing happend.It still at the 1st frame of the gif.
Guys, like @PabloLerma says, you need pod 'SDWebImage/GIF'.
I added pod 'SDWebImage/GIF' but it's installing SDWebImage like the pod 'SDWebImage'
Oh yeah, you don't need to add pod 'FLAnimatedImage' but the pod 'SDWebImage' and pod 'SDWebImage/GIF' only,also you need to add FLAnimatedImageView to your UIImageView in storyboard (if you use storyboards). Now it works! Thanks!
Closing, based on the previous comment. Also the Readme has been updated with more clear instructions on the Podfile.
Following all the instructions given, inspirationImageView.sd_setImage(with: imageUrl) call still doesnt play the gif but just shows the first frame of the gif
@vishal-i4gs make sure inspirationImageView is of type FLAnimatedImageView
@bpoplauschi the completion handler of sd_setImage returns an image of type of UIImage? or FLAnimatedImage?. I usually crop images in the completion handler
I thinks it's UIImage, especially since FLAnimatedImage is a subclass of UIImage.
For cropping, I would recommend you use the SDWebImageManagerDelegate and crop after retrieving the image, which is before being set. When you do it in the completion, the image was already set in the imageview.
Since its an UIImage and cropping an image will give back an UIImage as well. We do not have an FlLAnimatedImage to be put into the FLAnimatedImageView. So whats the possible way to crop the gif Image derived from the completion handler?
Hmm, tough question. I don't have a straight answer. You'd have to check FLAnimatedImage, maybe they have some capabilities there.
Most helpful comment
@talkaboutdesign do you have the subspec GIF in your podfile like this?:
pod 'SDWebImage/GIF'