SDWebImage checking if image cached using Swift: Ambiguous Reference

折月煮酒 提交于 2019-12-12 11:37:49

问题


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

let bool = SDWebImageManager.cachedImageExistsForURL(imgURL)

I am using Swift and I have a bridging header to use the library.


回答1:


cachedImageExistsForURL is not a class method on SDWebImageManager, it's an instance method which you need to use on the sharedInstance:

SDWebImageManager.sharedManager().cachedImageExistsForURL(imgURL)


来源:https://stackoverflow.com/questions/35870345/sdwebimage-checking-if-image-cached-using-swift-ambiguous-reference

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!