Skip to content

用于断点下载,支持后台和多任务并发下载,新增后台和任务队列

License

Notifications You must be signed in to change notification settings

LoveLifeLoveSelf/FGGDownloader

 
 

Repository files navigation

FGGDownloadManager

Cocoapods Compatible Pod Version Pod Platform

用于断点续传,退出程序后,下次启动后,恢复下载从上次下载位置开始下载

演示

##FGGDownloadManager用法简介
---------------------------------------------------------------------------------------------
##基于UNSURLConnection封装的断点续传类,用于大文件下载,退出程序后,下次启动接着下载。

#Install: ##Cocopods: pod 'FGGDownloader', '~> 1.1' ##Manual: download FGGDownloader and drag it into project。 #Useage: -->1.在项目中导入FGGDownloadManager.h头文件;
-->2.搭建UI时,设置显示进度的UIProgressView的进度值:[[FGGDownloadManager sharedManager] lastProgressWithUrl:url],
这个方法的返回值是float类型的;
设置显示文件大小/文件总大小的Label的文字:[[FGGDownloadManager sharedManager]fileSize:url];

-->3.开始或恢复下载任务的方法:[FGGDownloadManager sharedManager] downloadWithUrlString:(NSString *)urlString
toPath:(NSString *)destinationPath
process:(ProcessHandle)process
completion:(CompletionHandle)completion
failure:(FailureHandle)failure];

#Explain 这个方法包含三个回调代码块,分别是:

1)下载过程中的回调代码块,带3个参数:下载进度参数progress,已下载文件大小sizeString,文件下载速度speedString;
2)下载成功回调的代码块,没有参数;
3)下载失败的回调代码块,带一个下载错误参数error。

-->4.在下载出错的回调代码块中处理出错信息。在出错的回调代码块中或者暂停下载任务时,
调用[[FGGDownloadManager sharedManager] cancelDownloadTask:url]方法取消/暂停下载任务;

================================================================================
Copyright(c) 2016 CGPointZero. All rights reserved.

About

用于断点下载,支持后台和多任务并发下载,新增后台和任务队列

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 98.3%
  • Ruby 1.7%