Which data persists after app
Asked on 03/19/2025
1 search
In the context of Apple's WWDC sessions, data persistence in apps is primarily discussed in relation to SwiftData. SwiftData is a framework that facilitates the building of an app's model layer and ensures its persistence across app launches. This includes features like modeling, schema migration, graph management, and synchronization with CloudKit.
Persistent data in SwiftData is managed through a combination of model contexts and data stores. The data store is responsible for fetching and saving all the data required to support persistent models. SwiftData also supports history tracking, which allows apps to query and process changes over time, providing a way to track model changes and manage persistent history.
For more detailed information on how SwiftData handles data persistence, you can refer to the session What’s new in SwiftData (00:01:01) which covers the adoption of SwiftData and its persistence capabilities. Additionally, the session Create a custom data store with SwiftData (00:01:21) provides insights into how custom data stores can be implemented to manage persistent data.

Platforms State of the Union
Discover the newest advancements on Apple platforms.

Track model changes with SwiftData history
Reveal the history of your model’s changes with SwiftData! Use the history API to understand when data store changes occurred, and learn how to use this information to build features like remote server sync and out-of-process change handing in your app. We’ll also cover how you can build support for the history API into a custom data store.

Create a custom data store with SwiftData
Combine the power of SwiftData’s expressive, declarative modeling API with your own persistence backend. Learn how to build a custom data store and explore how to progressively add persistence features in your app. To get the most out of this session, watch “Meet SwiftData” and “Model your schema with SwiftData” from WWDC23.