1234567891011121314151617181920212223242526272829303132333435363738 |
- //
- // mixDownloadQueue.h
- // 双子星云手机
- //
- // Created by xd h on 2024/6/27.
- //
- #import <Foundation/Foundation.h>
- NS_ASSUME_NONNULL_BEGIN
- @interface mixDownloadQueue : NSObject
- /** 设置最大的并发下载个数 */
- @property (nonatomic, assign) NSInteger maxCount;
- @property (nonatomic,strong) NSURLSession *session;
- // 添加下载任务
- - (void)addDownloadWithSession:(NSURLSession *)session
- URL:(NSURL *)url
- begin:(void(^)(NSString * filePath))begin
- progress:(void(^)(NSInteger completeSize,NSInteger expectSize))progress
- complete:(void(^)(NSDictionary *respose,NSError *error))complet;
- - (void)startAllTasksWithSession:(NSURLSession *)session;
- // 供downloader 处理下载调用
- - (void)dataTask:(NSURLSessionDataTask *)dataTask didReceiveResponse:(NSURLResponse *)response;
- - (void)dataTask:(NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data;
- - (void)task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error;
- @end
- NS_ASSUME_NONNULL_END
|