Giter Club home page Giter Club logo

fggdownloader's Introduction

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.

fggdownloader's People

Contributors

insfgg99x avatar

Stargazers

双木雨 avatar

Watchers

James Cloos avatar 双木雨 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.