Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading GIFs in UICollectionView #220

Open
iPhoneNoobDeveloper opened this issue Jan 15, 2019 · 2 comments
Open

Loading GIFs in UICollectionView #220

iPhoneNoobDeveloper opened this issue Jan 15, 2019 · 2 comments

Comments

@iPhoneNoobDeveloper
Copy link

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.

@iPhoneNoobDeveloper iPhoneNoobDeveloper changed the title Loading GIF in UICollectionView Loading GIFs in UICollectionView Jan 15, 2019
@w99wen123dff
Copy link

be careful of the cell reuse. if the gif is downloaded from web.

@iPhoneNoobDeveloper
Copy link
Author

iPhoneNoobDeveloper commented Jan 25, 2019

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);
  
}];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants