• Stars
    star
    167
  • Rank 226,635 (Top 5 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 7 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple and powerful iOS downloader.

MCDownloader

A simple and powerful iOS downloader. 中文简介

Installation

Copy the source file to your project.

Usage

Start the download

[[MCDownloader sharedDownloader] downloadDataWithURL:[NSURL URLWithString:url] progress:^(NSInteger receivedSize, NSInteger expectedSize, NSInteger speed, NSURL * _Nullable targetURL) {
                
            } completed:^(MCDownloadReceipt * _Nullable receipt, NSError * _Nullable error, BOOL finished) {
                NSLog(@"==%@", error.description);
            }];

Stop the download

[[MCDownloader sharedDownloader] cancel:receipt completed:^{
            [self.button setTitle:@"Start" forState:UIControlStateNormal];
        }];

Remove the download

[[MCDownloader sharedDownloader] remove:receipt completed:^{
            [self.tableView reloadData];
        }];

Get the download information

MCDownloadReceipt *receipt = [[MCDownloader sharedDownloader] downloadReceiptForURLString:url];

Cancel and remove all downloads

[[MCDownloader sharedDownloader] cancelAllDownloads];

[[MCDownloader sharedDownloader] removeAndClearAll];

License

MCDownloader is released under an MIT license. See License.md for more information.