What are the new updates about SwiftData?

Asked on 06/11/2025

2 searches

The new updates about SwiftData, as presented at WWDC, include several enhancements and features:

  1. Schema Customization: SwiftData now includes a new schema macro to help avoid duplicate models. This allows for more efficient data modeling and management.

  2. Model Containers: There are new ways to set up and configure model containers, which are crucial for managing the data model within your app.

  3. Query Optimization: SwiftData introduces complex filters and a new macro to improve query performance, making data retrieval more efficient.

  4. Indexing and Uniqueness: The addition of index and unique features allows for more efficient queries and ensures that certain properties do not have duplicate entries.

  5. Custom Data Stores: SwiftData now supports custom data stores, allowing developers to use alternative backends like SQLite or a remote web service, providing greater flexibility in data storage solutions.

  6. History API: A new history API is available to track changes in the data store, which is useful for syncing data with remote services or handling changes from app extensions.

For more detailed information, you can refer to the session What’s new in SwiftData (00:00:07).