Dear all,
I have an app architecture related question.
According to MVVM design, a View should not directly access the Model. Only via a ViewModel access to the model should be possible.
In the UltimatePortfolio App, fetchRequest
in the view is used to access objects in CoreData. So in my understanding, a view is accessing the model directly, either with the property wrapper @FetchRequest
or via the initializer. Also, it creates a tight coupling between the view and CoreData, which may not be preferred.
Would that design choice not be in contrast to the MVVM design?
See also: Fetching objects from CoreData in SwiftUI
Maybe I'm getting something wrong or missed something (maybe the UltimatePortfolio App is not aiming for a MVVM design or similar, or the mentioned approach is indeed in accordance with MVVM design).
Any help is greatly appreciated.
Cheers
Tobias