A progressive download manager for Alamofire (Alamofire下载器)
The default support breakpoint continues.
Sequential Download(顺序下载 )
Downloading at the same time (同时下载)
Start downloading by default
ALDownloadManager.shared.download(url: downloadUrl)
Start downloading by default
ALDownloadManager.shared.download(url: downloadUrl)?.downloadProgress({ (progress) in
// update UI
}).downloadResponse({ (response) in
// DefaultDownloadResponse
})
info.progressChangeBlock = { (progress) in
}
The default support breakpoint continues.
ALDownloadManager.shared.suspend(url: downloadUrl)
The default support breakpoint continues.
ALDownloadManager.shared.download(url: downloadUrl)
pod 'Alamofire'
As long as your project has Alamofire.
you can add AlamofireExtension.swift,ALDownloadManager.swift,ALDownloadInfo.swift to the project
Single file download (单文件下载)
ALDownloadManager.shared.download(url: self.testUrl)?.downloadProgress(nil).downloadResponse(nil)
Multi file download at the same time (多文件同时下载)
ALDownloadManager.shared.changeDownloadState()
Multi file sequential downloads (多文件顺序下载)
ALDownloadManager.shared.changeWaitState(completeClose: nil)
Requirements
iOS 9.0+
Xcode 8.0+
Swift 3.0+