2 // SPUDownloaderDelegate.h
5 // Created by Mayur Pawashe on 4/1/16.
6 // Copyright © 2016 Sparkle Project. All rights reserved.
9 #if __has_feature(modules)
12 #import <Foundation/Foundation.h>
15 NS_ASSUME_NONNULL_BEGIN
17 @
class SPUDownloadData
;
19 @protocol SPUDownloaderDelegate
<NSObject
>
21 // This is only invoked for persistent downloads
22 - (void)downloaderDidSetDestinationName
:(NSString
*)destinationName temporaryDirectory
:(NSString
*)temporaryDirectory
;
24 // Under rare cases, this may be called more than once, in which case the current progress should be reset back to 0
25 // This is only invoked for persistent downloads
26 - (void)downloaderDidReceiveExpectedContentLength
:(int64_t)expectedContentLength
;
28 // This is only invoked for persistent downloads
29 - (void)downloaderDidReceiveDataOfLength
:(uint64_t)length
;
31 // downloadData is nil if this is a persisent download, otherwise it's non-nil if it's a temporary download
32 - (void)downloaderDidFinishWithTemporaryDownloadData
:(SPUDownloadData
* _Nullable
)downloadData
;
34 - (void)downloaderDidFailWithError
:(NSError
*)error
;