amirrajan / rubymotion-applied

RubyMotion documentation provided by the community. Submit a pull request to the docs for a free one year indie subscription.
Apache License 2.0
49 stars 10 forks source link

Sample that shows AFNetworking in RM #9

Open amirrajan opened 6 years ago

andrewhavens commented 6 years ago

What about AFMotion? Is the point of this to show how to use the CocoaPod or how to do networking?

amirrajan commented 6 years ago

My gut says to push everyone to just use AFNetworking, but I don't have a clear view of how terrible AFNetworking looks in ruby (and how much better it looks in AFMotion). At a minimum we could start with "Here's what AFNetworking looks like in Ruby, if this makes you die a little bit inside, here is what it looks like using AFMotion."

Thoughts?

andrewhavens commented 6 years ago

I think examples of both would be valuable. An example of how to use the AFNetworking CocoaPod and translating some Obj-C into RubyMotion would be a good tutorial in itself, but also documenting how to do it with AFMotion would give an example of how much nicer it can be using a RubyMotion gem.

amirrajan commented 6 years ago

Cool. I think that would be a great narrative. 👍

hboon commented 6 years ago

AFNetworking is good and AFMotion is great, but raw NSURLSession isn't that either too:

POST with NSURLSession in RubyMotion: https://gist.github.com/hboon/5dc789454242e65434681b937ebc47e9

GET with NSURLSession + Basic Auth in RubyMotion https://gist.github.com/hboon/15c093ec315019919e0a9185b2312f11