14

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?

Arun_
  • 1,806
  • 2
  • 20
  • 40
  • 1
    Please have a look at the [documentation](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#response-handling) – vadian Dec 15 '19 at 09:30

1 Answers1

23

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

AF.request(...).responseDecodable(of: ResponseType.self) { response in 
    ...
}
Jon Shier
  • 12,200
  • 3
  • 35
  • 37