Latest 0.0.2
Homepage https://github.com/ntian2/NTDownload
License MIT
Platforms ios 8.0
Authors



特性

  • 基于 URLSessionDownloadTask & Swift 3.1
  • 断点续传
  • 退出时保存进度

    要求

  • iOS 8+

    安装

    cocoapods

    pod 'NTDownload'

    GIF效果图

    图片效果演示

    使用方法

    // 控制器里设置代理 NTDownloadManager
    NTDownloadManager.shared.downloadManagerDelegate = self
    // 指定下载 URLString
    NTDownloadManager.shared.newTask(urlString: urlString, fileImage: nil)
    // 遵守 NTDownloadManager
    // 下载完成 在这里改变 UI
    func finishedDownload(task: NTDownloadTask)

    Cell上获取实时下载进度 遵守 NTDownloadTaskDelegate

    // 下载进度
    func downloadTaskUpdateProgress(task: NTDownloadTask, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64)
    // 开始下载 在这里改变 UI
    func downloadTaskDownloading(task: NTDownloadTask)
    // 暂停下载 在这里改变 UI
    func downloadTaskStopDownload(task: NTDownloadTask)

    License

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

Latest podspec

{
    "name": "NTDownload",
    "version": "0.0.2",
    "summary": "iOS u4e0bu8f7d u65adu70b9u4e0bu8f7d u540eu53f0u65adu70b9u4e0bu8f7d u9000u51faApp u79bbu7ebfu65adu70b9u4e0bu8f7d u4f7fu7528 Swift 3.1",
    "homepage": "https://github.com/ntian2/NTDownload",
    "license": "MIT",
    "authors": {
        "ntian2": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/ntian2/NTDownload.git",
        "tag": "0.0.2"
    },
    "source_files": [
        "NTDownload",
        "NTDownload/download/NTDownload/*.swift"
    ],
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This