0
我无法理解下面的语法在alamofire库的功能,只有点分离的方法。拨打斯威夫特
Alamofire.request(.GET, "https://someWebsite.com/api/", parameters: ["key":"2121"])
.responseJSON { response in
if let JSON = response.result.value {
print("JSON: \(JSON)")
}
}
为什么responseJSON
方法没有前缀?而且,为什么这个方法在它的体内有一个完成处理程序,它不应该是方法的参数吗?即
.responesJSON(response in ...)
OR
.responseJSON(){respones in ....}