I would like to access to variables in other structs to have a total count.
Example code would demonstrate better:
struct level1: View {
@State var score1 = 5
}
struct level2: View {
@State var score2 = 7
}
In another struct, I would like to be able use score1 and score2 variables. The below code doesn't work, but I need something like this.
struct finalScore: View {
@State var totalScore = level1.score1 + level2.score2
}
