Why is WelcomeView passed in the history variable without a dollar sign but ExerciseView needs the dollar sign? Is it because ExerciseView is modifying the data while WelcomeView isn’t?
struct ContentView: View {
@State private var history = HistoryStore()
@State private var selectedTab = 9
var body: some View {
TabView(selection: $selectedTab) {
WelcomeView(history: history, selectedTab: $selectedTab)
.tag(9)
ForEach(0 ..< Exercise.exercises.count) { index in
ExerciseView(history: $history, selectedTab: $selectedTab, index: index)
.tag(index)
}
}
.tabViewStyle(PageTabViewStyle(indexDisplayMode: .never))
}
}