1. Core Idea

SwiftUI views are value types and are recreated frequently.

State is stored separately from the view so it persists across updates.

SwiftUI follows a single source of truth model.

UI = function of state

2. @State

Definition

@State is used to store local, mutable state owned by a view.

Behavior

Example

@State private var isNight = false

Key Point

The view owns this state.


3. @Binding

Definition