我用
SDWebImage来下载图片.如果成功下载图像,我想进一步操作.
cell.appIcon.sd_setImage(with: url,placeholderImage: UIImage.init(named: "App-Default"),completed: {(image: UIImage!,error: NSError!,cacheType: SDImageCacheType,imageURL: URL!) -> Void in // Perform operation. })
但是我收到了错误:
Cannot convert value of type ‘(UIImage!,NSError!,SDImageCacheType,URL!) -> Void’ to expected argument type ‘SDExternalCompletionBlock?’
解决方法
终于解决了.
cell.appIcon.sd_setImage(with: url!,placeholderImage: UIImage(named: "App-Default"),options: SDWebImageOptions(rawValue: 0),completed: { (image,error,cacheType,imageURL) in // Perform operation. })