Latest 1.0.7
Homepage https://github.com/notohiro/PriorityDownloader
License MIT
Platforms ios 9.0, requires ARC
Authors

Podfile

To integrate PriorityDownloader into your Xcode project using CocoaPods, specify it in your Podfile:

platform :ios, '9.0'
use_frameworks!
pod 'PriorityDownloader', '~> 1.0'

Then, run the following command:

$ pod install

Usage

Creating a Download Task

NSNotificationCenter.defaultCenter().addObserver(self, selector: "downloadFinished:", name: PriorityDownloaderNotification.name, object: nil)
let downloader = PriorityDownloader.sharedDownloader
let URL = NSURL(string: "https://raw.githubusercontent.com/notohiro/PriorityDownloader/master/PriorityDownloaderTests/imgs/01.jpg")
if let aURL = URL {
    downloader.addQueue(aURL, priority: nil)
    downloader.startDownload()
}

Recieve Notification

func downloadFinished(notification: NSNotification) {
    if let userInfo = notification.userInfo {
        let data = userInfo[PriorityDownloaderNotification.data]! as! NSData
    }
}

Latest podspec

{
    "name": "PriorityDownloader",
    "version": "1.0.7",
    "summary": "A Light Weight Downloader with Priority Controller.",
    "homepage": "https://github.com/notohiro/PriorityDownloader",
    "license": "MIT",
    "authors": {
        "Hiroshi Noto": "[email protected]"
    },
    "source": {
        "git": "https://github.com/notohiro/PriorityDownloader.git",
        "tag": "1.0.7"
    },
    "platforms": {
        "ios": "9.0"
    },
    "requires_arc": true,
    "source_files": "PriorityDownloader/*"
}

Pin It on Pinterest

Share This