ZYiOS
ZYiOS

Reputation: 5280

SDWebImage crash in swift

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

                        })
                }
            })

Upvotes: 3

Views: 4412

Answers (1)

ColinE
ColinE

Reputation: 70122

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.

Upvotes: 2

Related Questions