Understanding mobile networking
Working with the network is a crucial part of developing apps for iOS. Understanding how the network fits into our app architecture is essential, but what does it mean? Watching simple tutorials about performing a URLSession
request is fine, but real-world apps don’t work that way.
Before we dive any deeper, let’s recap what a basic app architecture looks like:
- UI layer: This is responsible for presenting UI to the user, including responding to user inputs. The UI layer consists of the SwiftUI/UIKit views and view models.
- Business logic: This is responsible for manipulating data while managing the basic application logic.
- Data layer: This is responsible for storing and retrieving data entities related to the business logic.
I guess I’m not surprising you here with this three-layer architecture, as most mobile apps work in a similar architecture.
When we begin to understand where the network job fits,...