Objective-C块:
[networHandler composeRequestWithMethod:MethodRespondToAppointMent
paramas:queryParams //NSDictionary
onComplition:^(BOOL success, NSDictionary *response){
// NSLog(@"Dict: %@", response);
}];
现在我想在Swift中代表这一点。我该怎么办?
更新
let handler = NetworkHandler.sharedInstance() as! NetworkHandler
let dict = ["":""]
handler.composeRequestWithMethod("", paramas: dict) { (success, response) -> Void in
}
这对我有用。
答案 0 :(得分:0)
在Swift中,如果尾随参数是一个闭包,你也可以使用缩短版的Anbu.Karthik的答案:
networHandler.composeRequestWithMethod(MethodRespondToAppointMent, paramas: queryParams) { success, response in
// NSLog(@"Dict: %@", response)
}