-
Notifications
You must be signed in to change notification settings - Fork 6
/
MVFileDownload.h
30 lines (24 loc) · 1004 Bytes
/
MVFileDownload.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
#import <Foundation/Foundation.h>
@class MVFileDownload;
@protocol MVFileDownloadDelegate
@optional
- (void)fileDownloadDidStart:(MVFileDownload*)fileDownload;
- (void)fileDownload:(MVFileDownload*)fileDownload
didProgress:(float)percent;
- (void)fileDownloadDidFinish:(MVFileDownload*)fileDownload;
- (void)fileDownload:(MVFileDownload*)fileDownload
didFailWithError:(NSError*)error;
@end
@interface MVFileDownload : NSObject
@property (strong, readonly) NSURL *sourceURL;
@property (strong, readonly) NSURL *destinationURL;
@property (readonly) float downloadPercentage;
@property (readonly, getter = isFinished) BOOL finished;
@property (readonly, getter = isError) BOOL error;
@property (strong, readonly) NSOperationQueue *operationQueue;
@property (weak, readwrite) NSObject <MVFileDownloadDelegate> *delegate;
- (id)initWithSourceURL:(NSURL*)sourceURL
destinationURL:(NSURL*)destinationURL
operationQueue:(NSOperationQueue*)operationQueue;
- (void)start;
@end