-
Notifications
You must be signed in to change notification settings - Fork 45
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
Alamofire extension for Alamofire 3.x #53
Comments
If I'm correct, it would be something like this (correct me if I'm wrong):
|
Hey, I don't have Alamofire around or a test project, but maybe
to
|
Why switching the optional to a normal type make it better? However I realized that my suggested implementation is not the best solution, I will suggest another way soon, but I have to try it out properly first. My fault was that these two "responseObject" methods should use the Alamofire type "Response" instead of "Result". |
Ok, after some experiment I now get why you suggested changing "T?" to "T" and "[T]?" to "[T]": to avoid double optionals. Handling serialization failures is better by using Errors than returning success with Optional value. |
right for errors you want to use Failure
|
Haven't tested this just wrote it based on what you have
Usage
|
I came up with something similar, though I prefer having if-else for the success and failure rather than guard, but that is just personal preference. Also, I declared a domain and error code for errors.
|
Why are you closing this? As I detailed in #59, I only asked the example to be added to the README. |
Hi!
I see there is an Alamofire Request extension example in the README, but if I'm correct it is not for the newest, 3.x version of Alamofire. Can you update it to show how can OCMapper be used with Alamofire 3.x. It would be really appreciated!
The text was updated successfully, but these errors were encountered: