📜  alamofire 取消所有请求 - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:21.743000             🧑  作者: Mango

代码示例1
Alamofire.SessionManager.default.session.getTasksWithCompletionHandler { (sessionDataTask, uploadData, downloadData) in
    sessionDataTask.forEach { $0.cancel() }
    uploadData.forEach { $0.cancel() }
    downloadData.forEach { $0.cancel() }
}