Hi Ben, thanks once again for producing such high quality content. I’ve benefited a lot from your tutorials, and hope that you continue to keep up the good work!
I have a question for you about Dependency Injection and Networking in iOS:
If I have multiple View Controllers in my app which require network functionality. For example, I have one call to URLSession which pulls a generic list of data to populate a UITableView, and the next ViewController needs to make ANOTHER network call to a different API in order to pull more specific data from a REST API in order to populate that Details screen. Should I use Dependency Injection, and technically have multiple instances of my URLSession class to connect to different API, or do I use a Singleton (which I would like to avoid), and use a single reference from my Networking layer in order to call multiple API’s? What is the best approach between these two options, and is there a third option which is even better which I’m overlooking? Just wondering.
Thanks once again Ben for your time!