๐ธstate
terms โฉ state
The information stored in a variable, applilcation, or system at a given time. For example, if a variable level = 4, its current state is 4.
SwiftUI updates your views' appearances automatically whenever your app's state changes. One common way to change view states is through user interaction, such as when a person taps a Button.
struct ContentView: View {
// โญ๏ธ view state (data)
@State var isOn = true
// UI
var body: some View { ... }
}property๏ผvariable stored inside a type.
๏ผ State๏ผa property wrapper that tells SwiftUI to manage the storage for a view state.
view state๏ผthe state of a view
Last updated