我正在使用AFNetworking,并且在将下面的代码转换为swift时遇到了一个问题
目标C
[client GET:url parameters:nil success:^(AFHTTPRequestOperation * _Nonnull operation, id _Nonnull responseObject) {
} failure:^(AFHTTPRequestOperation * _Nullable operation, NSError * _Nonnull error) {
}];快速代码(给出错误)
self.client.GET(url,
parameters: nil,
success: { (operation: AFHTTPRequestOperation!, responseObject: AnyObject!) in
},
failure: { (operation: AFHTTPRequestOperation!, error: NSError!) in
})发布于 2015-11-23 12:44:15
这应该是可行的:
self.client.GET(url, parameters: nil, success: { (operation: AFHTTPRequestOperation, responseObject: AnyObject?) in
}, failure: { (operation: AFHTTPRequestOperation?, error: NSError) in
})https://stackoverflow.com/questions/33871037
复制相似问题