From ad09af4b163d43d8d47a451ce8d63da97d8159f5 Mon Sep 17 00:00:00 2001 From: rinsuki <428rinsuki+git@gmail.com> Date: Thu, 28 Apr 2022 07:05:15 +0900 Subject: [PATCH] fix --- Sources/Core/ImageCache.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/Core/ImageCache.swift b/Sources/Core/ImageCache.swift index d81151a02..41d473077 100644 --- a/Sources/Core/ImageCache.swift +++ b/Sources/Core/ImageCache.swift @@ -36,6 +36,7 @@ public extension UIImageView { func loadImage(from url: URL?, callback: (() -> Void)? = nil) { guard let url = url as? NSURL else { NSLog("overwrite image with URL nil") + image = nil uiImageViewLastLoadingURL.removeObject(forKey: self) if let oldOne = uiImageViewCancelToken.object(forKey: self) { oldOne.cancel() @@ -51,6 +52,7 @@ public extension UIImageView { if let oldOne = uiImageViewCancelToken.object(forKey: self) { oldOne.cancel() } + image = nil let cancellable = SDWebImageManager.shared.loadImage(with: url as URL, options: [], progress: nil) { [weak self] image, _, _, _, _, _ in guard let self = self else { return