AlamoFireImage缓存已过滤且原始图像

时间:2017-07-25 00:13:38

标签: swift caching filter alamofireimage

应用过滤器时,过滤后的图像会被缓存:

let filter = AspectScaledToFillSizeWithRoundedCornersFilter(
   size: kSize,
   radius: kRadius
)

myImageView.af_setImage(
   withURL: imageUrl,
   placeholderImage: placeholderImage,
   filter: filter
)

但之后,当我请求NOT过滤图像(原始图像)时,它没有被缓存:

myImageView.af_setImage(
   withURL: imageUrl,
   placeholderImage: placeholderImage
)

在第一次调用中,下载原始图像,但仅缓存过滤后的图像。我希望在第一次调用中立即缓存过滤后的图像和原始图像。是否有可能优雅地做到这一点?谢谢!

0 个答案:

没有答案