The state of networking in iOS workflow

By@M@Aug 27, 2025

Every iOS app for the most part will at some point need to reach out to the internet to get some data so that it can do something useful. Being that it's such a common thing that most devs will run into at some point and given Apple's usual polish to products, its probably something that you think would be quite straightforward but in practice, is not.

Networking code has always been a challenge for developers going back to the objective-c days of iOS development, however with the introduction of Swift as the main language it brought along with it things like strict typing and new project workflows. Where does your code for networking now reside in a MVC styled project, or with SwiftUI, MVVM? Do you create a service to handle it? How does that data make it through the app to the function / view that needs it? These were all things that until recently were handled in different ways in almost every app, resulting in 3rd party packages such as Alamofire being the choice for new projects to simplify / standardize the networking code.

Nowadays, with new modules such as URLSession and MVVM being the defacto project organization for swiftUI, we have a much more standard workflow for implementing networking code. Though the URLSession code can be quite boilerplate, its also very simple and easy to understand, additionally, the code can be implemented in ViewModels as a standard.

Though many projects still have something like a networking service that defines endpoint information / routes, most of the actual networking code that is run to make a request now is in the ViewModel, which directly handles data for the View in the MVVM structure. Though I think the current tools could benefit from some more verbose logging (like reporting back the HTTP code by default etc) I think that networking could become even easier than it is now, I hope that apple continues to iterate on URLSession in the future so that we can get even better networking tools :)


Test code :D