Is SwiftData built on top of CoreData?
Asked on 08/01/2024
1 search
Yes, SwiftData is built on top of CoreData by default. According to the Platforms State of the Union, SwiftData uses CoreData to store information by default, but it also allows for custom data stores, enabling the use of alternative backends like SQLite, a remote web service, or even a collection of JSON files. This flexibility allows developers to use SwiftData's API with various storage solutions.

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.

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.

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