AlamofireCoreData icon indicating copy to clipboard operation
AlamofireCoreData copied to clipboard

trying to refactor the request method

Open mariusschoenefeld opened this issue 7 years ago • 0 comments

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
        }
}

mariusschoenefeld avatar Jun 08 '18 14:06 mariusschoenefeld