Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trying to refactor the request method #2

Open
mariusschoenefeld opened this issue Jun 8, 2018 · 0 comments
Open

trying to refactor the request method #2

mariusschoenefeld opened this issue Jun 8, 2018 · 0 comments

Comments

@mariusschoenefeld
Copy link

I am trying to create one function for different types and requests.

In your call a Many.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 mariusschoenefeld changed the title trying to refactor the Request method trying to refactor the request method Jun 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant