【问题标题】:hanekeswift remove image from all FormatNamehanekeswift 从所有 FormatName 中删除图像
【发布时间】:2016-04-14 02:54:42
【问题描述】:

当我通过.hnk_setImageFromUrl 扩展功能将图像设置为UIImageView(缩放)时,使用Haneke Swift,我怎样才能再次从缓存中删除它。 我试过了:

profileImageView.hnk_setImageFromURL(NSURL(string: imageUrl)!)
Shared.imageCache.remove(key: imageUrl!)

检查文件系统并读取代码,它只会从HanekeGlobals.Cache.OriginalFormatName 中删除图像 这仍然会导致 Auto*aspectfill 缓存中的缓存图像

shared-images/auto-160.0x160.0-aspectfill:
-rw-r--r-- 1 user1 staff 123123 9 Jan 13:26 https%3A%2F%2Fapi.example.com%2Fpubapi%2Fusers%2Fuser%2Fpicture`

这是预期的行为吗?

当然,完全清除缓存总是一个想法 与

Shared.imageCache.removeAll()

【问题讨论】:

    标签: ios swift caching uiimageview haneke


    【解决方案1】:

    开发人员告诉我以下内容:

    你可以这样做:

    Shared.imageCache.remove(key: imageUrl, formatName: profileImageView.hnk_format.name)
    

    不过,我认为我们可能应该有一个removeFromAll 方法。

    【讨论】:

    • 它对你有用吗?我仍然无法从缓存中删除数据。对于只设置缓存的库来说应该是一件简单的事情。
    猜你喜欢
    • 2016-05-20
    • 1970-01-01
    • 2015-06-21
    • 2014-01-07
    • 2018-08-14
    • 2017-07-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多