faizaanshamsi/rubymotion_yelp — pull request #1 by markrickert (2014-01-14 20:32:26+00:00)
Title: Some cleanup and separation of network code

Hey! Great job here creating your first app that uses `ProMotion` and `formotion` (both of which i'm a contributor on).

I thought maybe you'd like to see some of the design patterns I use on my RubyMotion projects so I put together a few modifications for you to check out.

Most notably, I separated out the http calls to their own class that takes a block. That way we can separate the http logic form the application and parsing logic. This pattern is heavily based on Matt Green's Inspect 2013 talk here: http://vimeo.com/69529067

I also removed the need to use the `NSUserDefaults` the way you were using them and passing the category/location directly to the screen using attributes. It makes it much cleaner sending the data that way and there's a clear path of how the data flows form one screen to the next.

Hope this helps your understanding of separation of concerns and a bit more about how ProMotion works!

-Mark