-
Notifications
You must be signed in to change notification settings - Fork 99
/
TWRDownloadObject.h
33 lines (26 loc) · 1.24 KB
/
TWRDownloadObject.h
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
33
//
// TWRDownloadObject.h
// DownloadManager
//
// Created by Michelangelo Chasseur on 26/07/14.
// Copyright (c) 2014 Touchware. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreGraphics/CGBase.h>
typedef void(^TWRDownloadRemainingTimeBlock)(NSUInteger seconds);
typedef void(^TWRDownloadProgressBlock)(CGFloat progress);
typedef void(^TWRDownloadCompletionBlock)(BOOL completed);
@interface TWRDownloadObject : NSObject
@property (copy, nonatomic) TWRDownloadProgressBlock progressBlock;
@property (copy, nonatomic) TWRDownloadCompletionBlock completionBlock;
@property (copy, nonatomic) TWRDownloadRemainingTimeBlock remainingTimeBlock;
@property (strong, nonatomic) NSURLSessionDownloadTask *downloadTask;
@property (copy, nonatomic) NSString *fileName;
@property (copy, nonatomic) NSString *friendlyName;
@property (copy, nonatomic) NSString *directoryName;
@property (copy, nonatomic) NSDate *startDate;
- (instancetype)initWithDownloadTask:(NSURLSessionDownloadTask *)downloadTask
progressBlock:(TWRDownloadProgressBlock)progressBlock
remainingTime:(TWRDownloadRemainingTimeBlock)remainingTimeBlock
completionBlock:(TWRDownloadCompletionBlock)completionBlock;
@end