Tiny iOS library based on AFNetworking that helps the developer to create a downloading dialog with progress view, with less then 10 lines of code.
DownloadFile *operation = [[DownloadFile alloc] init];
[operation startDownloadFile:[NSURL URLWithString:@"http:// ..."]
outputName:@"downloadedFile"
loadingTitle:@"Downloading file ..."
withFinishCallback:^(DownloadFileStatus status, NSError *error) {
switch (status) {
case kDownloadFileStatusUserAborted:
NSLog(@"User aborted");
break;
case kDownloadFileStatusError:
NSLog(@"Download error: %@", error);
break;
default:
NSLog(@"Download OK");
break;
}
}];
- Drag & drop inside your project the folder named DownloaderWithProgression
- Add to your project the awesome framework AFNetworking
- That's all!
Some unit tests are available here
DownloaderWithProgression is available under the MIT license. See the LICENSE file for more info.
Follow me on twitter @capezzbr