【发布时间】:2014-12-05 23:51:54
【问题描述】:
我正在使用 Alamofire 下载一个有进度的文件,但我不知道如何暂停/恢复/取消特定请求。
@IBAction func downloadBtnTapped() {
Alamofire.download(.GET, "http://httpbin.org/stream/100", destination: destination)
.progress { (bytesRead, totalBytesRead, totalBytesExpectedToRead) in
println(totalBytesRead)
}
.response { (request, response, _, error) in
println(response)
}
}
@IBAction func pauseBtnTapped(sender : UIButton) {
// i would like to pause/cancel my download request here
}
【问题讨论】: