Closed deezaster closed 4 years ago
Did you resolve this?
i have this problem too.
This has been fixed in https://github.com/tristanhimmelman/AlamofireObjectMapper/pull/288
I just changed the type DataResponse
to AFDataResponse
.
What I had:
responseData(completionHandler: { (dataResponse: DataResponse<Data>) in }
What I have now:
responseData(completionHandler: { (dataResponse: AFDataResponse<Data>) in }
I've got error when updated Alamofire from 5.0.0-beta.7 to 5.0.0-rc.2
You can look here https://github.com/tristanhimmelman/AlamofireObjectMapper/pull/284
Closing as the PR to fix this has been merged and released
Hi
I'm still getting this error with below pods, i tried all mentioned Git master but nothing working.
Getting this error in XCODE11 with swift 5.
When i use AFDataResponse instead of DataResponse then issue go away. i don't whether its the correct approach to resolve the same ?
Please Help me to get out of it. thanks
pod 'Alamofire', '~> 5.0.0-rc.2' pod 'ObjectMapper', '~> 3.4'
pod 'AlamofireObjectMapper', '~> 6.2.0'
@suryakantkachhi , did you try to change (response: DataResponse<LoginDSModel>)
to (response: AFDataResponse<LoginDSModel>)
?
_ = AF.request(URL, method: .get).responseObject { (response: AFDataResponse
let mappedObject = response.value
print(mappedObject?.location)
AlamofireObjectMapper-6.2.0.zip see here
DataResponse<Any,AFError>
I am getting the same. What should I do?
This is how i made it to work.
Response is a struct to parse the response.
struct Response: Codable {
let test : String
}
static func getApiRequest(url:String, parameters:Dictionary<String, Any>,completion:@escaping (AFResult<Response>)->Void) {
let headers = configureCurrentSession()
AF.request(url,method: .get, encoding : JSONEncoding.default,headers:headers).responseDecodable { (response: AFDataResponse<Response>) in
completion(response.result)
return
}
}
Please @tristanhimmelman, update the README.md inserting the latest versions for Carthage and Cocoa. I spent hours trying to solve the incompatibility issue of AFDataResponse<T>
as parameter of responseObject {...}
.
I tried all of the mentioned approaches but nothing worked for me.
Versions i use:
AlamofireObjectMapper 6.1.0 ObjectMapper 3.5.1 Alamofire 5.0.0-rc.2
Problem with .responseArray:
Error: