【问题标题】:How to use "responseDecodable" method in Alamofire?如何在 Alamofire 中使用“responseDecodable”方法?
【发布时间】:2019-12-15 09:10:53
【问题描述】:

我一直在尝试使用 Alamofire 中的“responseDecodable”方法,但在使用时出现“无法推断通用参数 'T'”错误。

谁能指导我如何解决这个问题?

【问题讨论】:

标签: ios swift alamofire swift5


【解决方案1】:

正如您在documentation 中看到的,使用responseDecodable 很简单:

AF.request(...).responseDecodable(of: ResponseType.self) { response in 
    ...
}

【讨论】:

    猜你喜欢
    • 2022-08-02
    • 2021-03-13
    • 2020-08-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多