Swift方法需要分隔符

时间:2016-01-10 16:12:38

标签: swift swift2

我创建了以下方法:

class func getAEDbyReference(reference: String, completionHandler: (Result<AED, NSError>) -> Void {
    Alamofire.request(Router.GetAED(reference)).responseObject{(response: Response<AED, NSError>) in
        completionHandler(response.result)
}

我得到的错误是:Expected ',' separator

但为什么呢?我没有看到错误

1 个答案:

答案 0 :(得分:1)

Void

之后加上右括​​号
class func getAEDbyReference(reference: String, completionHandler: (Result<AED, NSError>) -> Void) {
    Alamofire.request(Router.GetAED(reference)).responseObject{(response: Response<AED, NSError>) in
    completionHandler(response.result)
}