Checking SDWebImage if an image is cached using Swift: Ambiguous reference

I am trying to find out if the image has already been cached using SDWebImage, but when I try to use this method, I get the error message "Ambiguous reference to the cachedIageExistsForURL element".

let bool = SDWebImageManager.cachedImageExistsForURL(imgURL)

I use Swift, and I have a bridge header to use the library.

+4
source share
2 answers

cachedImageExistsForURLis not a class method in SDWebImageManager, it is an instance method that must be used in sharedInstance:

SDWebImageManager.sharedManager().cachedImageExistsForURL(imgURL)
+6
source

how to achieve this in swift 4.2

0
source

All Articles