๐ธstate value
โฑ๐ง under construction
SwiftUI โฉ view โฉ state โฉ value
struct ContentView: View {
// โญ๏ธ declare & initialize a state value
@State var isOn = true
// UI
var body: some View { ... }
}
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.
๏ผ State๏ผdeclare and initialize a state value
Last updated
Was this helpful?