---
title: SwiftData updates
framework: updates
role: article
role_heading: Article
path: updates/swiftdata
---

# SwiftData updates

Learn about important changes to SwiftData.

## Overview

Overview Browse notable changes in SwiftData. June 2026 Section your query results by creating your query with a macro that takes a sectionBy parameter, as listed on the Additional query macros page. Use types that conform to Codable in a model, including types you don’t control directly, by using the  codable option for Schema.Attribute. Receive real-time updates to models that match specified fetch criteria by using the ResultsObserver type. Observe remote model changes with the HistoryObserver type. June 2025 Increase the flexibility of your models by adopting inheritance through the Model() macro. Gain added flexibility in accessing and sorting transaction history using sortBy in the HistoryDescriptor. June 2024 Macros Improve performance of sorts and predicate-based fetches by using the Index(_:) macro to define individual and compound indexes. Define a unique constraint that includes one or more model attributes using the Unique(_:) macro, enabling SwiftData to regard tuples of attributes as unique. Specify nil as a relationship’s inverse to create a unidirectional relationship. Persistent history Fetch historical changes for one or more persistent models using the model context’s fetchHistory(_:) method. Delete stale model history from a persistent store by calling the context’s deleteHistory(_:) method. Provide an alternate change tracking strategy for your custom persistent store by adopting the HistoryProviding protocol. Custom persistent stores Adopt the DataStore protocol (and related protocols) to provide custom storage for your app’s persistent models.

## See Also

### Technology and frameworks

- [Accelerate updates](updates/accelerate.md)
- [Accessibility updates](updates/accessibility.md)
- [ActivityKit updates](updates/activitykit.md)
- [AdAttributionKit Updates](updates/adattributionkit.md)
- [App Clips updates](updates/appclips.md)
- [App Intents updates](updates/appintents.md)
- [AppKit updates](updates/appkit.md)
- [Apple Intelligence updates](updates/apple-intelligence.md)
- [AppleMapsServerAPI Updates](updates/applemapsserverapi.md)
- [Apple Pencil updates](updates/applepencil.md)
- [ARKit updates](updates/arkit.md)
- [Audio Toolbox updates](updates/audiotoolbox.md)
- [AuthenticationServices updates](updates/authenticationservices.md)
- [AVFAudio updates](updates/avfaudio.md)
- [AVFoundation updates](updates/avfoundation.md)
