swift - Alamofire 请求出现错误 'Extra Argument in call'

标签 swift firebase swift3 alamofire

我搜索了很多与我想要的问题类似的问题,但找不到答案。我的语法与其他答案不同,无法弄清楚。我已迁移到 Swift 3,并将 Alamofire cocopod 更新到 4.3 后,出现错误:

Extra Argument in call

这是我获取的代码:

request = Alamofire.request(.GET, post.imageURL!).validate(contentType: ["image/*"]).response(completionHandler: { (request, response, data, err) in

有人可以告诉我新的代码吗?

最佳答案

最终的答案是这样的:

request = Alamofire.request(post.profileImage!).validate(contentType: ["image/*"])
                    .response { response in

                        if response.error == nil {
                        let image = UIImage(data: response.data!)!

我希望这对某人有帮助。 :)

关于swift - Alamofire 请求出现错误 'Extra Argument in call',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42301525/

相关文章:

android - 基于 firebase 的移动应用数据服务器设计

javascript - 引用错误 : noticication_id is not defined in firebase notification

ios - 选取图像后 imageview 不更新

ios - Pod Install : Ignoring ffi-1. 13.1 因为它的扩展没有被构建。试试 : gem pristine ffi --version 1. 13.1

ios - Swift 中 super 简单的尾随闭包语法

ios - 停止对 firebase 的查询?

ios - Swift3,可变字符串数组的扩展

Swift 3 反射 - 迭代属性

iphone - 使用 searchBar 时隐藏后退按钮

swift - 在应用程序内禁用自动亮度