Summary
In this chapter, we examined the problem of adding user responsiveness to the views we create in SwiftUI and Appleās solution, which uses @State
variables bindings for view structs, giving examples for Button
, TextField
, and Picker
.
We stated the purpose and limits of struct view bindings.
We also examined the problem of bidirectional data bindings across views and dependent child views, including how to mock data in previews of child views.
In the next chapter, we will start learning about advanced layouts with scroll views, controlling focus, iterating lists, and ScrollViewReader
.