What's new in SwiftData??
Asked on 02/13/2025
1 search
In the "What's new in SwiftData" session at WWDC 2024, several new features and improvements were introduced for SwiftData, a framework designed to model and persist app data across Apple's platforms. Here are the key updates:
-
Schema Macro: A new schema macro helps avoid duplicate models, enhancing the efficiency of your data models.
-
Model Containers: There are new ways to set up and configure model containers, allowing for more flexibility in how data is managed within your app.
-
Query Optimization: You can now optimize queries with complex filters and use a new macro to improve performance, making data retrieval faster and more efficient.
-
Index Macro: The introduction of the index macro allows for more performant queries by indexing properties that are commonly queried together.
-
Unique Constraints: You can add unique constraints to your schema to prevent duplicate entries and improve data integrity.
-
History API: A new history API is available 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.
-
Custom Data Stores: SwiftData now supports custom data stores, allowing you to use alternative backends like SQLite or a remote web service, providing greater flexibility in data storage solutions.
For more detailed information, you can refer to the session What’s new in SwiftData.

Swift Charts: Vectorized and function plots
The plot thickens! Learn how to render beautiful charts representing math functions and extensive datasets using function and vectorized plots in your app. Whether you’re looking to display functions common in aerodynamics, magnetism, and higher order field theory, or create large interactive heat maps, Swift Charts has you covered.

Platforms State of the Union 5-Minute Recap
Watch a quick recap of the newest advancements on Apple platforms.

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.