SwiftUI State Management: @State, @Binding, @Observable and Beyond

SwiftUI gives you several property wrappers for state, and the framework has evolved meaningfully since it launched — especially with iOS 17’s @Observable macro. This guide is an index to the property wrappers, navigation, and view-identity concepts that make up state management in SwiftUI, along with the Swift language fundamentals they build on.

Choosing a State Wrapper

Start here if you’re not sure which property wrapper a given piece of state needs:

Modernizing to @Observable (iOS 17+)

If your minimum deployment target is iOS 17 or later, Apple’s @Observable macro replaces ObservableObject/@Published and removes several of the older distinctions above:

Why Views Update (or Don’t)

  • SwiftUI View Identity — how SwiftUI decides whether to preserve or reset a view’s state, and why list rows sometimes lose state after a reorder.

Navigation

  • NavigationStack — programmatic, path-driven navigation, and why it replaced NavigationView.

Persistence

Swift Language Fundamentals

State management assumes you’re comfortable with the underlying Swift language. These cover the basics that come up constantly in SwiftUI code: