写这样一个文章的目的 是因为无论google 还是百度甚至国外的文章blog 都没有关于这样客观 而切很实用的文章 可并行下载 可点击暂停 可点击继续 并且支持断点续传 并且保存下载文件的大小
1 首先 demo 中我用到了cocoapods 如果有同学想学习如何使用 可以留言 我单独写一篇关于cocoapods的文章 包括(为自己项目开源支持cocoapods) 闲话少叙 来正文 我是急于AF 2.x 的封装下载

这里面为保存所有的 operation 即所有的下载引擎 关键点来了

根据url 获取你要操作的引擎
下载 暂停 继续

下面是具体请求部分

其中保存了 文件的大小 其中我用到自己封装的 model数据库 根据fmdb 进行封装
如有需要此demo 请留言附带邮箱地址本文DEMO
网友评论