forked from chasseurmic/TWRDownloadManager
-
Notifications
You must be signed in to change notification settings - Fork 2
/
TWRDownloadObject.m
32 lines (28 loc) · 1.04 KB
/
TWRDownloadObject.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//
// TWRDownloadObject.m
// DownloadManager
//
// Created by Michelangelo Chasseur on 26/07/14.
// Copyright (c) 2014 Touchware. All rights reserved.
//
#import "TWRDownloadObject.h"
@implementation TWRDownloadObject
- (instancetype)initWithDownloadTask:(NSURLSessionTask *)downloadTask
progressBlock:(TWRDownloadProgressBlock)progressBlock
cancelBlock:(TWRDownloadCancelationBlock)cancelBlock
errorBlock:(TWRDownloadErrorBlock)errorBlock
remainingTime:(TWRDownloadRemainingTimeBlock)remainingTimeBlock
completionBlock:(TWRDownloadCompletionBlock)completionBlock {
self = [super init];
if (self) {
self.isRedownload = NO;
self.downloadTask = downloadTask;
self.progressBlock = progressBlock;
self.remainingTimeBlock = remainingTimeBlock;
self.completionBlock = completionBlock;
self.cancelationBlock = cancelBlock;
self.errorBlock = errorBlock;
}
return self;
}
@end