SwiftData in WWDC2025

Asked on 06/12/2025

1 search

At WWDC 2025, SwiftData was highlighted in the session titled "SwiftData: Dive into inheritance and schema migration." This session introduced new features and improvements to SwiftData, including:

  1. Class Inheritance: New in iOS 26, SwiftData now supports class inheritance, allowing developers to build a model graph that harnesses inheritance. This is particularly useful when your models form a natural hierarchy and share characteristics. For example, in the Trips app, the Trip model can have subclasses that inherit properties like destination, start date, and end date.

  2. Schema Migration: The session also covered strategies for evolving data with migration, ensuring that data is preserved as the schema changes over time.

  3. Performance Optimization: Techniques for tailoring fetched data and observing changes to data were discussed to optimize performance.

For more detailed information, you can watch the session SwiftData: Dive into inheritance and schema migration.

Additionally, the "Platforms State of the Union" session mentioned improvements to SwiftData, including model subclassing, entity inheritance, and support for additional common data types like AttributedString. These enhancements make SwiftData more flexible and powerful for developers working across Apple's platforms.