Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 416
Arun_ Avatar asked Jan 24 '26 15:01

Arun_


1 Answers

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

AF.request(...).responseDecodable(of: ResponseType.self) { response in 
    ...
}
like image 160
Jon Shier Avatar answered Jan 27 '26 05:01

Jon Shier



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!