Downloader depend on AFNetworking
The preferred installation method is with CocoaPods. Add the following to your Podfile:
pod 'QDDownloader', '~> 0.1.2'
NSUInteger taskId = [[QDDownloadManager manager] downloadWithUrl:downloadUrl progress:^(int64_t completedUnitCount, int64_t totalUnitCount) {
dispatch_async(dispatch_get_main_queue(), ^{
NSLog(@"prgress:%f", completedUnitCount / 1.0 / totalUnitCount);
});
} didFinished:^(QDDidFinishedStatus status, NSString *filePath) {
if (status == QDDidFinishedStatusSuceess) {
NSLog(@"download success");
} else {
NSLog(@"download fail");
}
}];
[[QDDownloadManager manager] cancelTask:taskId];
QDDownloader is released under the MIT license. See LICENSE for details.