/SwiftUIObservationProject

The demo shows how to use the new Observation in SwiftUI for data flow. It compares the performance of exisitng data flow with @State, @StateObject and Observable with the new Observation feature.

Managing Model Data for SwiftUI with the new Observation Feature

Configure the sample code project

To run the sample app:

  1. Select a development team in the Signing & Capabilities tab of the target settings.
  2. If your Mac is running macOS 14 or later, select My Mac as the destination; otherwise, select an iOS device or simulator running iOS 17 or later.
  3. Build and run the app.

Observation vs ObservableObject

The detailed description can be found in this blog post: Simplifying Data Flow and Improving Performance in SwiftUI with Observation

this project is originaly from the WWDC 2023 Managing model data in your app.

I modified it to show the difference to the older data flow with ObservableObject. Check out this Youtube video where I discuss this in more detail: https://youtu.be/xcKT_wgq_EQ