【问题标题】:Swift: how to save UIImage as data in cache, retrieve it from url, then delete it?Swift:如何将 UIImage 保存为缓存中的数据,从 url 检索它,然后删除它?
【发布时间】:2021-05-23 09:35:12
【问题描述】:

我希望能够在缓存目录中存储一个Data 对象(来自UIImage),并且能够在需要时检索它并删除它。 我该怎么做?

感谢您的帮助

【问题讨论】:

标签: ios swift caching uiimage


【解决方案1】:

你可以使用这个 pod:https://github.com/onevcat/Kingfisher

  • Kingfisher 是一个功能强大的纯 Swift 库,用于下载和
    缓存来自网络的图像。它为您提供了一个使用
    在您的下一个应用中处理远程图像的纯 Swift 方式。

【讨论】:

    猜你喜欢
    • 2018-10-29
    • 1970-01-01
    • 1970-01-01
    • 2015-06-07
    • 2023-03-20
    • 2014-01-24
    • 2018-07-05
    • 2018-11-19
    • 1970-01-01
    相关资源
    最近更新 更多