What's new in SwiftData?
Asked on 01/31/2025
2 searches
In the "What's new in SwiftData" session at WWDC 2024, several new features and improvements were introduced for SwiftData. Here are the highlights:
-
Schema Macro: A new schema macro helps avoid duplicate models, making it easier to manage your data models efficiently.
-
Model Containers: There are new ways to set up and configure model containers, which are essential for managing your app's data models.
-
Query Optimization: You can now optimize queries with complex filters and use a new macro to improve performance.
-
Index Macro: The index macro allows you to make queries more performant by specifying which properties are commonly queried together.
-
Unique Constraints: You can add unique constraints to your schema to prevent duplicate entries and enhance query performance.
-
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 different persistence backends, such as SQLite or a remote web service.
For more detailed information, you can refer to the session What’s new in SwiftData (00:07).

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

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.

Bring context to today’s weather
Harness the power of WeatherKit to get detailed weather forecast data such as precipitation amounts by type, cloud cover by altitude, or maximum wind speed. Find out how you can summarize weather by different parts of the day and highlight significant upcoming changes to temperature or precipitation. Understand how you can compare current weather to the past through our Historical Comparisons dataset and dive into historical weather statistics for any location in the world. We’ll also explore how you can do all of this faster with our Swift and REST APIs.