mzeeshanid / MZDownloadManager

This download manager uses NSURLSession api to download files. It can download multiple files at a time. It can download large files if app is in background. It can resume downloads if app was quit.
BSD 3-Clause "New" or "Revised" License
1.12k stars 238 forks source link
downloader downloadmanager nsurlsession

MZDownloadManager

CI Status Version License Platform

mzdownload manager hero

Features

This download manager uses the URLSession api to download files.

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

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:

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

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, mzeeshanid@yahoo.com

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.