SDWebImage: High memory use
SDWebImageManager *manager = [SDWebImageManager sharedManager];
[manager downloadImageWithURL:post.imageURL options:0 progress:^(NSInteger receivedSize, NSInteger expectedSize)
{
// float progress = (float)receivedSize/expectedSize;
// [cell.imageViewFoto updateProgress:progress];
}
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
if (image) {
[cell.imageViewFoto setupImageView:post indexPath:indexPath isGrid:NO image:image];
}
}];
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 38 (16 by maintainers)
Ok. I added https://github.com/SDWebImage/SDWebImage/wiki/Common-Problems#configuration-for-large-images-avoid-high-memory-usage
After lots of R&D and applying all kind of options for SDImageCache, I have finalized below options to set to avoid crash on heavy images load with the Best performance on RAM cache load:
Hope this will help you all !!!
Add below code into your AppDelegate class:
import SDWebImage
How to use:
//MARK:- Load Image with Activity Indicator
loadImageWith(imgView: cell.imgViewProduct, url: product.p_image)