learn swiftdata
Asked on 06/16/2025
1 search
To learn about SwiftData, you can explore several sessions from Apple's WWDC that cover different aspects of the framework:
-
SwiftData: Dive into inheritance and schema migration: This session introduces SwiftData, focusing on class inheritance and schema migration. It explains how to model and persist your app's data using SwiftData, and discusses strategies for data migration and optimizing data fetches.
-
What’s new in SwiftData: This session provides an overview of the new features in SwiftData, including schema macros, model containers, and query optimizations. It also covers how to avoid duplicate models and improve performance with complex filters.
-
Create a custom data store with SwiftData: This session explains how to implement a custom data store using SwiftData, allowing you to use any persistence backend. It covers the new Datastore protocol and how to integrate it with your app.
-
Track model changes with SwiftData history: This session focuses on SwiftData history, which lets your app track modifications to its data. It explains how to use history to build features that process data changes, such as syncing with a server or responding to app extension changes.
These sessions provide a comprehensive understanding of SwiftData, from basic usage to advanced features like custom data stores and data history tracking.

SwiftData: Dive into inheritance and schema migration
Discover how to use class inheritance to model your data. Learn how to optimize queries and seamlessly migrate your app’s data to use inheritance. Explore subclassing for building model graphs, crafting efficient fetches and queries, and implementing robust schema migrations. Understand how to use Observable and persistent history for efficient change tracking.

What’s new in SwiftData
SwiftData makes it easy to add persistence to your app with its expressive, declarative API. Learn about refinements to SwiftData, including compound uniqueness constraints, faster queries with #Index, queries in Xcode previews, and rich predicate expressions. Join us to explore how you can use all of these features to express richer models and improve performance in your app. To discover how to build a custom data store or use the history API in SwiftData, watch “Create a custom data store with SwiftData” and “Track model changes with SwiftData history”.

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.