How to clear all cached images loaded from SDWebImage?

前端 未结 4 2038
不知归路
不知归路 2020-12-09 16:07

I have all images loaded on my app via SDWebImage. The downloading and caching works great, but I wanted to make a button that can clear all cached images in the entire app.

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-09 16:59

    Swift 5

    import SDWebImage
    
      SDImageCache.shared.clearMemory()
    
      SDImageCache.shared.clearDisk()
    

提交回复
热议问题