Swiftdata grouped
Asked on 06/30/2025
1 search
SwiftData is a framework introduced by Apple to simplify the process of building and persisting your app's model layer across launches. It offers features such as schema modeling, migration, graph management, and synchronization with CloudKit.
In the session titled "What’s new in SwiftData" from WWDC 2024, several enhancements to SwiftData were discussed, including:
- Schema Customization: You can now avoid duplicate models with a new schema macro and set up model containers more efficiently.
- Indexing: The index macro allows you to specify keypaths for properties that are frequently used in sorting and filtering, making queries faster and more efficient.
- Custom Data Stores: SwiftData now supports custom data stores, allowing you to use different backends like SQLite or JSON files while still using SwiftData's API.
- Xcode Previews: Enhancements to Xcode previews make it easier to work with SwiftData queries while iterating on views.
For more detailed information on these features, you can refer to the session What’s new in SwiftData (00:57).
Additionally, the session "SwiftData: Dive into inheritance and schema migration" from WWDC 2025 covers the introduction of class inheritance in SwiftData, which allows for building model graphs that harness inheritance, making it easier to manage models that form a natural hierarchy.
If you have specific questions about SwiftData or need timestamps for particular features, feel free to ask!

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”.

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 Create ML
Explore updates to Create ML, including interactive data source previews and a new template for building object tracking models for visionOS apps. We’ll also cover important framework improvements, including new time-series forecasting and classification APIs.