/ALDownloadManager

A progressive download manager for Alamofire

Primary LanguageSwiftMIT LicenseMIT

ALDownloadManager

A progressive download manager for Alamofire (Alamofire下载器)

The default support breakpoint continues.

Sequential Download(顺序下载 )

image  

Downloading at the same time (同时下载)

image

DownloadManager

Create a DownloadManager

Start downloading by default

ALDownloadManager.shared.download(url: downloadUrl)

Create a DownloadManager with progress.

Start downloading by default

 ALDownloadManager.shared.download(url: downloadUrl)?.downloadProgress({ (progress) in
     // update UI
                    
 }).downloadResponse({ (response) in
     // DefaultDownloadResponse
                    
 })

Add progress Observers for the DownloadManager

info.progressChangeBlock = { (progress) in
                  
}

Suspend the DownloadManager

The default support breakpoint continues.

ALDownloadManager.shared.suspend(url: downloadUrl)

Continue a suspended DownloadManager.

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+