UIActivityIndicator-for-SDWebImage
UIActivityIndicator-for-SDWebImage copied to clipboard
Complete closure is called 4 times per image
I use the following code in an `init()`` constructor:
if let url: NSURL = NSURL(string: previewCard.getImageUrls().getWithInt(0) as! String) {
self.imageView?.setImageWithURL(url, placeholderImage: MGImage.imageWithColor(UIColor.clearColor()), options: SDWebImageOptions.RefreshCached, completed: { (image:UIImage!, error:NSError!, type:SDImageCacheType, loadUrl:NSURL!) -> Void in
println("-------------- done")
}, usingActivityIndicatorStyle: UIActivityIndicatorViewStyle.Gray)
}
The console output is:
println("-------------- done")
println("-------------- done")
println("-------------- done")
println("-------------- done")
Why is the complete closure called four times? Is this a bug?
I cannot verify this; but I have also found performance issues with this component in the past.
@fatuhoku Do you have any workaround?
No; I solved my performance issue by not simply not using UIActivityIndicator-for-SDWebImage at all! No indicator is better than slow scrolling.
Which performance issues are you talking about. How many images did you use when you had issues?
@confile I used NZCircularImageView inside of UICollectionViewCells. It loads this component. It made scrolling really really slow!