New in coreData

Asked on 2025-08-04

1 search

At WWDC 2024, several sessions introduced new features and improvements related to CoreData and its integration with SwiftData. Here are some key highlights:

  1. SwiftData History: SwiftData now provides a history API that allows you to track changes to your app's models. This is particularly useful for apps that need to sync local changes with a remote web service. You can migrate from CoreData's persistent history to SwiftData history, which offers a more streamlined approach to tracking changes. For more details, you can refer to the session Track model changes with SwiftData history.

  2. Custom Data Stores: SwiftData now supports custom data stores, allowing you to use alternative backends like SQLite, a remote web service, or even a collection of JSON files. This flexibility enables you to use SwiftData's API with various storage formats. More information can be found in the session What’s new in SwiftData.

  3. Schema Customization and Indexing: SwiftData introduces new macros for schema customization, including the index macro, which improves query performance by indexing frequently queried properties. This is particularly beneficial for large datasets. You can learn more about these features in the session What’s new in SwiftData.

These enhancements make it easier to manage and persist data across Apple's platforms, providing developers with more tools to optimize their apps' data handling capabilities.

New in coreData | Ask WWDC