小编Zee*_*han的帖子

如何在Alamofire中暂停/恢复/取消我的下载请求

我正在使用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
}
Run Code Online (Sandbox Code Playgroud)

ios swift alamofire

19
推荐指数
2
解决办法
2万
查看次数

标签 统计

alamofire ×1

ios ×1

swift ×1