Comprehensive and Detailed Explanation From App Development with Swift domains:
This question belongs to View Building with SwiftUI , specifically the objective on using @State, @Binding, @Environment, and observable data to share data between views.
The correct answer is @Binding because @Binding creates a two-way connection to a value that is owned by another view. In this scenario, View A owns the state, and View B needs to read and modify that value so the change is reflected back in View A. Apple’s SwiftUI documentation describes a binding as a reference to a mutable value that is owned elsewhere, which is exactly the pattern used when a child view needs to update a parent view’s state. ( developer.apple.com )
@State is not correct for View B here because @State is used for local state owned by that specific view. If View B used @State, it would manage its own separate copy rather than updating the parent’s value. @Environment is used to access values provided by the system or ancestor views, not for directly returning a specific parent state value in this pattern. @Observable is related to observable model objects and is not the direct property wrapper used in a child view for two-way parent-child state passing. ( developer.apple.com )
So when View A passes a state value into View B and expects updates to flow back, View B should use @Binding .