Latest 1.1
Homepage https://github.com/Insfgg99x/FGGDownloader
License MIT
Platforms ios 6.0, requires ARC
Frameworks Foundation, UIKit
Authors

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.

Latest podspec

{
    "name": "FGGDownloader",
    "version": "1.1",
    "summary": "FGGDownloader is used for resume from break point downloading.",
    "homepage": "https://github.com/Insfgg99x/FGGDownloader",
    "license": "MIT",
    "authors": {
        "CGPointZero": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Insfgg99x/FGGDownloader.git",
        "tag": "1.1"
    },
    "frameworks": [
        "Foundation",
        "UIKit"
    ],
    "platforms": {
        "ios": "6.0"
    },
    "source_files": "FGGDownloader/*.{h,m}",
    "requires_arc": true
}

Pin It on Pinterest

Share This