无法转换“ DownloadTask”类型的返回表达式?返回类型“ RetrieveImageTask?”

时间:2019-05-03 21:19:28

标签: swift kingfisher

我需要帮助,返回部分出现错误,并且标题中有错误

extension UIImageView {
    @discardableResult
    func setImage(from url: URL, with placeholder: UIImage? = nil, completion: CompletionHandler? = nil) -> RetrieveImageTask? {

        ImageCache.default.retrieveImage(forKey: url.absoluteString, options: [], completionHandler: {
            image, _ in
            self.image = image
        })

        return kf.setImage(with: url, placeholder: placeholder,options: [KingfisherOptionsInfoItem.transition(ImageTransition.fade(0.2))],
            progressBlock: nil,
            completionHandler: completion)
    }
}

0 个答案:

没有答案