New in swift data

Asked on 06/12/2025

1 search

In the session titled "What’s new in SwiftData" from WWDC 2024, several new features and improvements were introduced for SwiftData. Here are some of the highlights:

  1. Schema Macro: A new schema macro helps avoid duplicate models, enhancing the efficiency of your app's data model.

  2. Model Containers: There are new ways to set up and configure model containers, allowing for more customization, including the ability to create custom data stores.

  3. Index Macro: This new feature allows you to add indexes to your data models, which can significantly speed up queries by optimizing how data is stored and retrieved.

  4. History API: A new history API is introduced to track changes to your app's models, which is useful for features like syncing with a server or responding to changes from an app extension.

  5. Custom Data Stores: You can now create custom data stores that use your own document format or persistence backend, providing flexibility in how data is stored.

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