🔸state

terms ⟩ state

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 { ... }
    
}

Last updated

Was this helpful?