HYDownloadManager
一个工具,用于文件下载,具有内存缓存、临时缓存和永久存储。
如何使用
- 并行下载:HYDownloadManager
//Start the download request for a URL, note that the same URL will never be downloaded twice
+ (void) downloadItemWithURL:(NSURL*)url
useCache:(BOOL)useCache;
//Delegate based events
// 1 url download operation can have multiple listeners
// But 1 listener cannot listen to 1 url download operation
+ (void) attachListener:(id<HYDownloadManagerDelegate>)listener toURL:(NSURL*)url;
- 顺序下载:HYSequentialDownloadHandler
+ (HYSequentialDownloadHandler*) downloadingHandlerWithURLs:(NSArray*)urls
progressBlock:(HYSequentialProgressBlock)progressBlock
completionBlock:(HYSequentialCompletionBlock)completionBlock
tag:(NSInteger)tag;