Need help with MCDownloadManager?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

agelessman
203 Stars 42 Forks MIT License 38 Commits 6 Opened issues

Description

A simple and convenient multi task download manager

Services available

!
?

Need anything else?

Contributors list

# 351,229
C
C++
18 commits

MCDownloadManager

A simple and convenient multi task download manager

Attention

这个版本默认只支持同时下载10个文件 This version only supports 10 file downloads at the same time.

若要支持更多,请修改下边的代码

configuration.HTTPMaximumConnectionsPerHost = 10;

添加了速度提示(比如:400KB/s)

支持后台和锁屏下载

Installation

Cocoapods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.1.0+ is required to build MCDownloadManager 1.0.0+.

To integrate MCDownloadManager into your Xcode project using CocoaPods, specify it in your

Podfile
:
pod 'MCDownloadManager', '~> 1.0.3'

Then, run the following command:

$ pod install

Usage

- (void)download {
    [[MCDownloadManager defaultInstance] downloadFileWithURL:self.url
                                                    progress:^(NSProgress * _Nonnull downloadProgress, MCDownloadReceipt *receipt) {

                                                    if ([receipt.url isEqualToString:self.url]) {
                                                        self.progressView.progress = downloadProgress.fractionCompleted ;
                                                    }

                                                }
                                             destination:nil
                                                 success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, NSURL * _Nonnull filePath) {
                                                     [self.button setTitle:@"播放" forState:UIControlStateNormal];
                                                 }
                                                 failure:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, NSError * _Nonnull error) {
                                                     [self.button setTitle:@"重新下载" forState:UIControlStateNormal];
                                                 }];

}

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.