Giter Club home page Giter Club logo

mzdownloadmanager's Introduction

MZDownloadManager

CI Status Version License Platform

mzdownload manager hero

Features

This download manager uses the URLSession api to download files.

  • Can download large files if app is in background.
  • Can download files if app is in background.
  • Can download multiple files at a time.
  • It can resume interrupted downloads.
  • User can also pause the download.
  • User can retry any download if any error occurred during download.

Screencast:

http://screencast.com/t/Rzm0xoRjGF

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • Xcode 8
  • Minimum deployment target is iOS 9.
  • For resuming downloads server must have resuming support.

Installation

MZDownloadManager is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "MZDownloadManager"

To install it by using Swift Package Manager:

Update

New helper functions added to support downloading at custom path. Example project is also updated about the usage.

To download file at custom path you can use the following instance method of MZDownloadManager:

public func addDownloadTask(fileName: String, fileURL: String, destinationPath: String)

When download completes:

  • It will check if the destination folder still exists then it will move the downloaded file at the specified destination and call success delegate method.
  • If destination folder does not exists, following delegate method will provide an opportunity to handle the downloaded file appropriately.

optional func downloadRequestDestinationDoestNotExists(downloadModel: MZDownloadModel, index: Int, location: NSURL)

  • If the above delegate method is not implemented then it will just called the failure method.

Important: This delegate method will be called on the session's queue.

Try In a Live App

MZDownloadManager is used in MZFileManager app. To learn more about the app features, visit this page.

Author

Muhammad Zeeshan, [email protected]

If you find MZDownloadManager userful consider donating thanks ;)
Donate button

License

MZDownloadManager is available under the BSD license. See the LICENSE file for more info.

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.