0
这给出了一个错误:“逃离封闭只能捕捉INOUT ......”Alamofire 4,斯威夫特3:不能返回的StatusCode
我怎样才能解决这个问题?
func check_info(tag: String, info: String, code: inout Int) {
Alamofire.request(
URL + "/api/test_information/",
method: .post,
parameters: [tag: info],
encoding: JSONEncoding.default
).responseString { response in
code = (response.response?.statusCode)!
}
}
谢谢您的回答!但我需要在另一个函数中使用此值 –
@MarkYankovsky现在检查,使用此回调函数它应该工作。没有自己测试,但这就是我使用它的方式 –
谢谢,但我怎么称呼这个功能?我从未使用过@escaping? –