AlamofireCoreData
AlamofireCoreData copied to clipboard
trying to refactor the request method
I am trying to create one function for different types and requests.
In your call a Many<Type>.self when ist's an Array of objects.
How can i realism to get the Object, so the NSManagedObject out of the variables?
So I end up with something like:
Alamofire.request(url)
.responseInsert(context: context, type: Many<VARIABLE>.self) { response in
switch response.result {
case let .success(user):
// The user object is already inserted in your context!
case .failure:
// handle error
}
}