Skip to content

A simple encapsulation of NSURLConnection files to download

License

Notifications You must be signed in to change notification settings

QianChia/QConnectionDownloader

Repository files navigation

Logo

QConnectionDownloader

  • A simple encapsulation of NSURLConnection files to download.

GitHub:QianChia | Blog:QianChia(Chinese)


Installation

From CocoaPods

  • pod 'QConnectionDownloader'

Manually

  • Drag all source files under floder QConnectionDownloader to your project.
  • Import the main header file:#import "QConnectionDownloader.h"

Examples

  • Start Download

     
     	[[QConnectionDownloader defaultDownloader] q_downloadWithURL:url progress:^(float progress) {
             
             dispatch_async(dispatch_get_main_queue(), ^{
                 [button q_setButtonWithProgress:progress lineWidth:10 lineColor:nil backgroundColor:[UIColor yellowColor]];
             });
             
         } successed:^(NSString *targetPath) {
             
             NSLog(@"successed:%@", targetPath);
             
         } failed:^(NSError *error) {
             
             NSLog(@"failed:%@", error);
         }];
     
  • Pause Download

     
     	[[QConnectionDownloader defaultDownloader] q_pauseWithURL:url];
     
  • Cancel Download

     	
     	[[QConnectionDownloader defaultDownloader] q_cancelWithURL:url];
    

About

A simple encapsulation of NSURLConnection files to download

Resources

License

Stars

Watchers

Forks

Packages

No packages published