【code_hyy_三方】SDWebImage底层实现原理?

2018-10-29  本文已影响0人  Hyyqinfen
SDWebImage底层实现原理:

其实是有沙盒缓存机制,主要由三块组成

1.内存图⽚缓存
2.内存操作缓存
3.磁盘沙盒缓存

setImageWithURL:placeholderImage:options: 先显⽰ 

placeholderImage ,
同时由SDWebImageManager根据URL 来在本地查找图⽚
downloadWithURL:delegate:options:userInfo: SDWebImageManager
是将UIImageView+WebCache同SDImageCache链接起来的类, 
SDImageCache: queryDiskCacheForKey:delegate:userInfo:⽤来从缓存根据CacheKey查找图⽚是否已经在缓存中
SDImageCacheDelegate : imageCache:didFindImage:forKey:userInfo:
SDImageCacheDelegate 回调 imageCache:didFindImage:forKey:userInfo:。进⽽回调
展⽰图⽚
回调imageCache:didNotFindImageForKey:userInfo:
上一篇下一篇

猜你喜欢

热点阅读