Bit6FileDownloader Class Reference
Inherits from | NSObject |
Declared in | Bit6FileDownloader.h |
Overview
Bit6FileDownloader handles the downloads of the framework using NSOperationQueue and NSURLSessionDownloadTask.
Class Methods
cancelOperations
Cancels all pending download operations.
+ (void)cancelOperations
Declared In
Bit6FileDownloader.h
downloadFileAtURL:toFilePath:preparationBlock:priority:completionHandler:
Download a file.
+ (void)downloadFileAtURL:(nonnull NSURL *)url toFilePath:(nonnull NSString *)filePath preparationBlock:(nullable NSData *_Nonnull ( ^ ) ( NSData *_Nonnull data ))preparationBlock priority:(NSOperationQueuePriority)priority completionHandler:(nullable void ( ^ ) ( NSURL *_Nullable location , NSURLResponse *_Nullable response , NSError *_Nullable error ))completionHandler
Parameters
- url
remote URL address of the file to download.
- filePath
local path where to save the file.
- preparationBlock
block to process the downloaded data before saving it to the filePath
- priority
the execution priority of the operation in the operation queue.
- completionHandler
Block to call after the operation has been completed. The “error” value can be use to know if the file was downloaded and saved in cache.
Declared In
Bit6FileDownloader.h