그래서 SDWebImage Download image and store to cache for key 이것은 내 응용 프로그램에서 수행하고자하는 작업입니다. 이미지를 키에 저장하고 나중에 이미지를 가져 오려고합니다. 이것은 코드 블록입니다.SDWebImage Download Image Completion Block이 호출되지 않음
SDWebImageManager.shared().imageDownloader?.downloadImage(with: URL.init(string: url), options: SDWebImageDownloaderOptions.highPriority, progress: { (receivedSize:Int,expectedSize:Int,url : URL?) in
print("progressing here in this block ")
}, completed: ({(image : UIImage, data : Data,error : Error, finished : Bool) in
print("reached in the completion block ")
if finished {
SDImageCache.shared().store(image, forKey: "d", toDisk: true, completion: nil)
} else {
print(error.localizedDescription)
showAlert(viewController: self, title: "", message: error.localizedDescription)
}
} as? SDWebImageDownloaderCompletedBlock))
그러나 완료 블록은 호출되지 않습니다.
print ("이 블록에서 진행 중입니다") : 인쇄가 진행되고 있습니까? –
그렇지 않으면 진행 블록에 도달하지만 완료 블록에 도달하지 못합니다. –
해결책이 있습니까? –