added iOS source code
[wl-app.git] / iOS / Pods / MZDownloadManager / README.md
1 # MZDownloadManager
2
3 [![CI Status](http://img.shields.io/travis/mzeeshanid/MZDownloadManager.svg?style=flat)](https://travis-ci.org/mzeeshanid/MZDownloadManager)
4 [![Version](https://img.shields.io/cocoapods/v/MZDownloadManager.svg?style=flat)](http://cocoapods.org/pods/MZDownloadManager)
5 [![License](https://img.shields.io/cocoapods/l/MZDownloadManager.svg?style=flat)](http://cocoapods.org/pods/MZDownloadManager)
6 [![Platform](https://img.shields.io/cocoapods/p/MZDownloadManager.svg?style=flat)](http://cocoapods.org/pods/MZDownloadManager)
7
8 ![mzdownload manager hero](https://cloud.githubusercontent.com/assets/2767152/18860606/655c21ea-8498-11e6-9bf9-05b5405d119a.jpg)
9
10 ## Features
11
12 This download manager uses the iOS 7 NSURLSession api to download files.
13 + Can download large files if app is in background.
14 + Can download files if app is in background.
15 + Can download multiple files at a time.
16 + It can resume interrupted downloads.
17 + User can also pause the download.
18 + User can retry any download if any error occurred during download.
19
20 <h3>Screencast:</h3>
21 http://screencast.com/t/Rzm0xoRjGF
22
23 ## Usage
24
25 To run the example project, clone the repo, and run `pod install` from the Example directory first.
26
27 ## Requirements
28
29 + Xcode 8
30 + Minimum deployment target is iOS 9.
31 + For resuming downloads server must have resuming support.
32
33 ## Installation
34
35 MZDownloadManager is available through [CocoaPods](http://cocoapods.org). To install
36 it, simply add the following line to your Podfile:
37
38 ```ruby
39 pod "MZDownloadManager"
40 ```
41
42 ## Update
43
44 New helper functions added to support downloading at custom path. Example project is also updated about the usage.
45
46 To download file at custom path you can use the following instance method of MZDownloadManager:
47     
48 ```public func addDownloadTask(fileName: String, fileURL: String, destinationPath: String)```
49       
50 #### When download completes:
51     
52 * 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.
53 * If destination folder does not exists, following delegate method will provide an opportunity to handle the downloaded file appropriately.
54
55 ```optional func downloadRequestDestinationDoestNotExists(downloadModel: MZDownloadModel, index: Int, location: NSURL)```
56
57 * If the above delegate method is not implemented then it will just called the failure method.
58
59 > Important: This delegate method will be called on the session's queue.
60
61 ## Author
62
63 Muhammad Zeeshan, mzeeshanid@yahoo.com
64
65 If you find MZDownloadManager userful consider donating thanks ;)</br>
66 [![Donate button](https://www.paypalobjects.com/en_US/DE/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BMKTVHYK6PUUG)
67
68 ## License
69
70 MZDownloadManager is available under the BSD license. See the LICENSE file for more info.