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

Complete closure is called 4 times per image #25

Open
confile opened this issue Jul 8, 2015 · 5 comments
Open

Complete closure is called 4 times per image #25

confile opened this issue Jul 8, 2015 · 5 comments

Comments

@confile
Copy link

confile commented Jul 8, 2015

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?

@fatuhoku
Copy link

I cannot verify this; but I have also found performance issues with this component in the past.

@confile
Copy link
Author

confile commented Jul 19, 2015

@fatuhoku Do you have any workaround?

@fatuhoku
Copy link

No; I solved my performance issue by not simply not using UIActivityIndicator-for-SDWebImage at all! No indicator is better than slow scrolling.

@confile
Copy link
Author

confile commented Jul 19, 2015

Which performance issues are you talking about. How many images did you use when you had issues?

@fatuhoku
Copy link

@confile I used NZCircularImageView inside of UICollectionViewCells. It loads this component. It made scrolling really really slow!

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