https://github.com/qiudaniel/qddownloader
Downloader depend on AFNetworking
https://github.com/qiudaniel/qddownloader
afnetworking download
Last synced: 10 months ago
JSON representation
Downloader depend on AFNetworking
- Host: GitHub
- URL: https://github.com/qiudaniel/qddownloader
- Owner: QiuDaniel
- License: mit
- Created: 2018-05-15T01:14:51.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-01-03T08:33:46.000Z (about 6 years ago)
- Last Synced: 2024-11-05T11:58:38.750Z (about 1 year ago)
- Topics: afnetworking, download
- Language: Objective-C
- Size: 54.7 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# QDDownloader
Downloader depend on AFNetworking
## Installation
### CocoaPods
The preferred installation method is with [CocoaPods](http://cocoapods.org). Add the following to your Podfile:
```ruby
pod 'QDDownloader', '~> 0.1.2'
```
## Usage
### Creating an Download Task
```objective-c
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");
}
}];
```
### Cancel Downloading Task
```objective-c
[[QDDownloadManager manager] cancelTask:taskId];
```
## License
QDDownloader is released under the MIT license. See [LICENSE](https://github.com/QiuDaniel/QDDownloader/blob/master/LICENSE) for details.