View { var flag: Bool var body: some View { if flag { Counter() .background(Color.blue) } else { Counter() .background(Color.red) } } } struct Counter: View { @State private var count = 0 var body: some View { Text("\(count)") .onTapGesture { count += 1 } } } fl BHUSVF ফ͞ΕΔ