3

it seems if I use "self" in the completed block, it will crash.

self.imageView.sd_setImageWithURL(MYIMAGEURL
            , placeholderImage: nil
            , options: SDWebImageOptions.RetryFailed
            , progress: {(receivedSize: Int!, expectedSize: Int!) in

            }
            , completed:{(image: UIImage?, error: NSError?, cacheType: SDImageCacheType!, imageURL: NSURL?) in
                if image {
                    UIView.transitionWithView(self.imageView
                        , duration: 0.3
                        , options: UIViewAnimationOptions.AllowUserInteraction | UIViewAnimationOptions.TransitionCrossDissolve
                        , animations: {

                        }
                        , completion: {(finished) in

                        })
                }
            })
ZYiOS
  • 5,204
  • 3
  • 39
  • 45

1 Answers1

2

The SDWebImageModule is an actively developed open source component. It is much better in this case to raise a bug on GitHub. The developers have already made a few releases that fix Xcode6 and Swift issues.

ColinE
  • 68,894
  • 15
  • 164
  • 232
  • Thanks ColinE, I use SDWebImage (3.7.1, the latest version) in my project. I raise a bug on github. – ZYiOS Jul 25 '14 at 06:45