Open iPhoneNoobDeveloper opened 5 years ago
be careful of the cell reuse. if the gif is downloaded from web.
I have successfully implemented FLAnimatedImageView in UICollectionView using "<SDWebImage/FLAnimatedImageView+WebCache.h>". But it slows down the GIF speed in case of different 10 instances of GIF URLs.
collectionCell.flaAnimatedImageView.sd_predrawingEnabled = FALSE;
[collectionCell.flaAnimatedImageView sd_setImageWithURL:[NSURL URLWithString:imageUrlString] placeholderImage:[UIImage imageNamed:@"default_"] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
CGDataProviderRef provider = CGImageGetDataProvider(image.CGImage);
NSData* data = (id)CFBridgingRelease(CGDataProviderCopyData(provider));
NSLog(@"File size is : %.2f MB",(float)data.length/1024.0f/1024.0f);
}];
I am loading GIFs in my horizontal UICollectionView. While scrolling UICollectionView, one cell's GIF exchange with another cell and then show's updated new GIF.