You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm in the early stages of developing an iOS application, which will consume a REST API. While GitHub, Apple docs, tutorials, etc. have been helpful in answering the majority of my questions thus far, I've recently experienced some hiccups while trying to learn more about networking. I haven't found an good, consolidated source of information regarding best practices/design patterns related to building out the networking layer of an application. I recently came across the source code for Artsy and have been reading over it as a guide to building a framework for consuming an API.
I do have a few questions though. Please, forgive me if they sound naive. Why is that the majority of the actual requests are implemented as class methods? What are the advantages of this approach, as opposed to creating some sort of "shared" singleton, which you would use to instantiate/get an instance of ARRouter and then make requests?
Also, there are calls to these ArstyApi class methods spread throughout. However, I don't understand exactly where/how this class is declared globally, allowing it to be recognized across many different class implementations.
Lastly, do you have plans to "Reactify" any portion of the networking layer. From what I've gathered, ReactiveCocoa and the functional programming it enables is a great fit for code that is heavy with callbacks/handlers, etc. A few other articles and iOS source code examples I have come across (SoundCloud and Timehop) have mentioned that if they haven't already done so, they were at least planning to adopt a more "Reactive" style within upcoming iterations of their code, specifically the networking layer.