一.SDWebImageManager
*1.本地内存是否存在
- (BOOL)cachedImageExistsForURL:(NSURL *)url;
*2.本地磁盘中是否存在
- (BOOL)diskImageExistsForURL:(NSURL *)url;
*3.判断是否存在于内存 然后执行操作
- (void)cachedImageExistsForURL:(NSURL *)url
completion:(SDWebImageCheckCacheCompletionBlock)completionBlock;
*4.判断是否存在于磁盘 然后执行操作
- (void)diskImageExistsForURL:(NSURL *)url
completion:(SDWebImageCheckCacheCompletionBlock)completionBlock;
*5.暂时不清楚以后补
- (NSString *)cacheKeyForURL:(NSURL *)url;
二.SDImageCache
*1.memory image cache 内存中像素点
@property (assign, nonatomic) NSUInteger maxMemoryCost;
*2.最多多少个文件
@property (assign, nonatomic) NSUInteger maxMemoryCountLimit;
*3.在内存中呆多少秒
@property (assign, nonatomic) NSInteger maxCacheAge;
*4.最多多少个字节
@property (assign, nonatomic) NSUInteger maxCacheSize;
*5.用一个键值存储已有image
- (void)storeImage:(UIImage *)image forKey:(NSString *)key;
- (void)storeImageDataToDisk:(NSData *)imageData forKey:(NSString *)key;
*6.根据键值获取image
- (UIImage *)imageFromMemoryCacheForKey:(NSString *)key;
- (UIImage *)imageFromDiskCacheForKey:(NSString *)key;
*7.根据键值对删除图片
*8.删除全部内存中图片
- (void)clearMemory;
*9.删除全部磁盘中图片
- (void)clearDisk;
*10.获取缓存中大小
- (NSUInteger)getSize;
- (NSUInteger)getDiskCount;
*11.硬盘中是否存在
- (BOOL)diskImageExistsWithKey:(NSString *)key;
网友评论