onevcat / Kingfisher

A lightweight, pure-Swift library for downloading and caching images from the web.
MIT License
23.41k stars 2.66k forks source link

How do I add suffixes to cache paths, such as.jpg #2248

Closed tzgd closed 5 months ago

tzgd commented 6 months ago

let cachePath = ImageCache.default.diskStorage.cacheFileURL(forKey: url.absoluteString)

zeroskylian commented 5 months ago

You can use ImageResource:

UIImageView().kf.setImage(with: KF.ImageResource(downloadURL: URL(string: "your url")!, cacheKey: "your cacheKey"))
tzgd commented 5 months ago

You can use ImageResource:

UIImageView().kf.setImage(with: KF.ImageResource(downloadURL: URL(string: "your url")!, cacheKey: "your cacheKey"))

多谢了