Swift SDWebImage永远不会执行完成

时间:2018-09-28 03:14:40

标签: swift sdwebimage

我一定很傻,但是SDWebImage从不执行以下内容的完成处理程序:

episodeImageView?.sd_setImage(with: url, completed: { [weak self] (image, error, cacheType, url) in
    print("Looped!") // NEVER!
    DispatchQueue.main.async {
        guard  let image = self?.episodeImageView?.image else { return }
        self!.episodeView.animate(image, imageAnimationDuration: 10, initialDelay: 0, shouldLoop: true)
    }
})

1 个答案:

答案 0 :(得分:0)

使用此代码

episodeImageView.sd_setImage(with: url) { (image, error, cacheType, url) in
    //Your Code
}