A NetworkManager is a centralized layer responsible for handling all network requests in an application.
It abstracts networking logic away from view controllers and provides a clean, reusable API layer.
ViewController
↓
NetworkManager
↓
URLSession
↓
Server
separates concerns
avoids duplicate code
improves maintainability
centralizes networking logic
A proper NetworkManager handles:
request creation
HTTP methods (GET, POST, etc.)
headers and body configuration
response validation
data decoding
error handling
ViewControllers → UI only
NetworkManager → networking only
same function used across multiple screens