Control and respond to the flow of data and changes within your app’s models.
Framework
- Swift
UI
Overview
States and bindings connect views to your app’s underlying data model. When you declare a state, SwiftUI stores it for you and manages the state’s connections to its view. When the state updates, the view invalidates its appearance and updates itself. You can also connect animations to the state to animate how the view portrays the change.
Create bindings from members of your state to connect to individual views. Bindings offer two-way connections, so that onscreen controls can mutate the state. Bindings also have transactions to pass values between views.