We introduced @State in the previous chapter. We’ll revisit that briefly here as well as discuss more concepts of the flow of data in SwiftUI.
Data Drives the UI
Typically , in app development, the UI represents the data and state. When the user taps a button or flips a switch, the event drives a method call. In that method, we typically have code that updates the current data.
In the last chapter, we looked at how we used @State to specify the source of truth for the toggle switch. By binding the isReady boolean variable to the toggle, we saw that toggling the switch updated the value. ...