我在swift中使用AFNetworking,我在将以下代码转换为swift时面临问题
目标C
[client GET:url parameters:nil success:^(AFHTTPRequestOperation * _Nonnull operation, id _Nonnull responseObject) {
} failure:^(AFHTTPRequestOperation * _Nullable operation, NSError * _Nonnull error) {
}];
Swift Code (出错)
self.client.GET(url,
parameters: nil,
success: { (operation: AFHTTPRequestOperation!, responseObject: AnyObject!) in
},
failure: { (operation: AFHTTPRequestOperation!, error: NSError!) in
})