Hi @Appeloper, I have question about MV architecture:
I have app with tabView (4 screens), one of them is called MenuView that contain all app features (more than 10).
I want to follow MV architecture I need to declare all stores in menuView like this :
struct MenuView: View {
@StateObject private var store1 = FeatureOneStore()
@StateObject private var store2 = FeatureTwoStore()
@StateObject private var store3 = FeatureThreeStore()
....
// mode, ...
var body: some View {
NavigationStack(path: $navigation.path) {
VStack {
}
.navigationDestination(for: ItemKey.self) { key in
// Push to features
}
}
.environmentObject(store1)
.environmentObject(store2)
.environmentObject(store3)
}
}
MenuView will end up with many stores, is that good ? or there is other solution
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: