ios - How to create different instance for SDWebImageManager -
i have many controllers download images using sdwebimage library. using following code
[[sdwebimagemanager sharedmanager] downloadimagewithurl:[nsurl urlwithstring:_urltodownloadfrom] options:0 progress:nil completed:^(uiimage *image, nserror *error, sdimagecachetype cachetype, bool finished, nsurl *imageurl) { _productinfo.isdownloading = false; _productinfo.isimagedownloadedscuessfully = finished; if (image) { [_productinfo setmainimg:image]; canshowlistview ? [self.listcollectionview reloaddata] : [self.gridcollectionview reloaddata]; } }];
as seen in code using sdwebimagemanager shared instance download data, because of these downloading operation go inside queue in fifo series. example have controller downloading 10 images, push controller above downloads more 5 images. these new images top controller have wait till previous controller download 10 images. how can solve problem? possible solution can think creating new instance of sdwebimagemanager, create sdwebimagedownloader shared instance.
have tried sdwebimagedownloader
? remember had queue of download operations , can configure number of concurrent downloads.
Comments
Post a Comment