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/xulhzbo5xrbf1.png?width=3608&format=png&auto=webp&s=8055edeaa0eb6ba71a77ae271ccd0241a1340801

Posted Jul 9, 2025, 4:09 AM UTC

32
Loading comments…