Files
keyboard/keyBoard/Class/Categories/KBWebImageManager.h
2025-10-29 20:57:45 +08:00

32 lines
826 B
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// KBWebImageManager.h
// keyBoard
//
// SDWebImage 的二次封装:全局配置、预取、缓存管理
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface KBWebImageManager : NSObject
/// 预取一组图片
+ (void)prefetchURLs:(NSArray<id> *)urlList
progress:(void(^_Nullable)(NSUInteger finished, NSUInteger total))progress
completed:(void(^_Nullable)(NSUInteger finished, NSUInteger skipped))completed;
/// 异步计算磁盘缓存大小(字节)
+ (void)calculateDiskSize:(void(^)(NSUInteger bytes))completion;
/// 清理内存+磁盘缓存
+ (void)clearAllCache:(void(^_Nullable)(void))completion;
/// 设置全局 HTTP Header如鉴权 Token
+ (void)setHTTPHeaderValue:(nullable NSString *)value forKey:(NSString *)field;
@end
NS_ASSUME_NONNULL_END