Skip to content

Commit

Permalink
Support CocoaPods
Browse files Browse the repository at this point in the history
  • Loading branch information
guowilling committed Apr 6, 2017
1 parent dc5f098 commit c23a016
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 18 deletions.
14 changes: 14 additions & 0 deletions SRDownloadManager.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

Pod::Spec.new do |s|
s.name = "SRDownloadManager"
s.version = "1.0.0"
s.summary = "Files download manager based on NSURLSession, support breakpoint download, multitasking download etc."
s.description = "Provide download status callback, download progress callback, download complete callback; Support multi-task at the same time to download; Support breakpoint download even exit the App; Support to delete the specified file by URL and clear all files that have been downloaded; Support customize the directory where the downloaded files are saved; Support set maximum concurrent downloads and waiting downloads queue mode."
s.homepage = "https://github.com/guowilling/SRDownloadManager"
s.license = "MIT"
s.author = { "guowilling" => "guowilling90@gmail.com" }
s.platform = :ios, "7.0"
s.source = { :git => "https://github.com/guowilling/SRDownloadManager.git", :tag => "#{s.version}" }
s.source_files = "SRDownloadManager/*.{h,m}"
s.requires_arc = true
end
36 changes: 18 additions & 18 deletions SRDownloadManagerDemo/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,24 +87,6 @@ - (void)viewDidLoad {
[self.downloadButton3 setTitle:@"Start" forState:UIControlStateNormal];
}

- (NSString *)titleWithDownloadState:(SRDownloadState)state {

switch (state) {
case SRDownloadStateWaiting:
return @"Waiting";
case SRDownloadStateRunning:
return @"Pause";
case SRDownloadStateSuspended:
return @"Resume";
case SRDownloadStateCanceled:
return @"Start";
case SRDownloadStateCompleted:
return @"Finish";
case SRDownloadStateFailed:
return @"Start";
}
}

#pragma mark - Actions

- (IBAction)deleteAllFiles:(UIBarButtonItem *)sender {
Expand Down Expand Up @@ -191,6 +173,24 @@ - (void)download:(NSURL *)URL totalSizeLabel:(UILabel *)totalSizeLabel currentSi
}
}

- (NSString *)titleWithDownloadState:(SRDownloadState)state {

switch (state) {
case SRDownloadStateWaiting:
return @"Waiting";
case SRDownloadStateRunning:
return @"Pause";
case SRDownloadStateSuspended:
return @"Resume";
case SRDownloadStateCanceled:
return @"Start";
case SRDownloadStateCompleted:
return @"Finish";
case SRDownloadStateFailed:
return @"Start";
}
}

- (IBAction)deleteFile1:(UIButton *)sender {

[[SRDownloadManager sharedManager] deleteFileOfURL:kDownloadURL1];
Expand Down

0 comments on commit c23a016

Please sign in to comment.