Latest 0.3.0
Homepage https://github.com/uxmstudio/UXMBatchDownloader
License MIT
Platforms ios 8.0
Authors

UXM Token Field

Version
License
Platform

Easily download massive numbers of files.

Installation

CocoaPods

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

pod "UXMBatchDownloader"

Usage

Simple example

let urls = [ "image_url_1", "image_url_2" ]

let downloader = UXMBatchDownloader(urls: urls)
downloader.maximumConcurrentDownloads = 5
downloader.progress = { (file, progress) in
    print("Finished Step (progress) : (file)")
}
downloader.start()

URL’s can be passed with or without a destination path. If no destination paths are passed, files will simply be downloaded to the documents folder with their original name.

Interface

var maximumConcurrentDownloads:Int
var completion:((urls: [String]) -> ())?
var progress:((file: String, progress: Float) -> ())?

init(urls: [String])
init(urls: [String], completion: ((urls: [String]) -> ())?)
init(objects: [UXMBatchObject])
init(objects: [UXMBatchObject], completion: ((urls: [String]) -> ())?)

func start()

func addUrl(url: String)
func addUrl(object: UXMBatchObject)
func addUrls(objects: [UXMBatchObject])

Batch Object

Instead of passing in just a URL’s, batch objects (UXMBatchObject) can be passed that contain a url, destination url, as well as options for number of download retries and whether or not the file should be backed up to iCloud.

var url:String
var destination:String?
var backupToCloud:Bool = false
var numberOfRetries:Int = 0

init(url: String, destination: String?, backupToCloud: Bool = false, numberOfRetries: Int = 0)

Author

Chris Anderson:

License

UXMBatchDownloader is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "UXMBatchDownloader",
    "version": "0.3.0",
    "summary": "Easily download massive numbers of files.",
    "description": "UXMBatchDownloader simplifies the arduous task of handling hundreds of file downloads concurrently without worrying about timeouts.",
    "homepage": "https://github.com/uxmstudio/UXMBatchDownloader",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Chris Anderson": "[email protected]"
    },
    "source": {
        "git": "https://github.com/uxmstudio/UXMBatchDownloader.git",
        "tag": "0.3.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "UXMBatchDownloader/Classes/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This