Arun_
Arun_

Reputation: 1826

How to use "responseDecodable" method in Alamofire?

I have been trying to use "responseDecodable" method from Alamofire, but I'm getting "Generic parameter 'T' could not be inferred" error while using it. Alamofire

Can someone guide me how to fix this?

Upvotes: 15

Views: 15827

Answers (1)

Jon Shier
Jon Shier

Reputation: 12770

As you can read in the documentation, using responseDecodable is straightforward:

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

Upvotes: 24

Related Questions