Skip to content

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.

Notifications You must be signed in to change notification settings

gahntpo/SwiftUIObservationProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published