Beginner here, is this the right data flow for a SwiftUI app?

Question

Hi everyone,

I'm a beginner learning how to structure SwiftUI apps and wanted to check if I'm on the right track. For handling data from an API, is this the correct workflow?

Request:

View → ViewModel → Repository → API

Data coming back:

API → Repository → ViewModel → View

Is this a good, standard pattern to follow for real-world projects?

Any advice would be a huge help. Thanks!

https://preview.redd.it/0u2kzpsywrbf1.png?width=3608&format=png&auto=webp&s=ec0088184fd6154629fda3152096cdc587bcc0ca

Posted Jul 9, 2025, 4:08 AM UTC

2713
Loading comments…