How does state restoration work?
Asked on 08/02/2024
1 search
State restoration in the context of WWDC sessions can be understood through several different technologies and use cases:
-
Core Spotlight:
- Client State: Core Spotlight uses client state to manage a large catalog of items and maintain data integrity between your app and Spotlight. This helps prevent over-donation of items, which can impact performance. When Spotlight needs to migrate the index or recover from data corruption, it requests your app to re-index items, ensuring the searchable content stays up to date.
- Support semantic search with Core Spotlight (00:03:46)
-
Core ML:
- Stateful Models: Core ML now supports stateful models, which manage state tensors automatically. This is useful for models that need to keep track of historical inputs, such as accumulators. This reduces the overhead and improves inference efficiency, leading to faster prediction times.
- Bring your machine learning and AI models to Apple silicon (00:14:34)
- Deploy machine learning and AI models on-device with Core ML (00:10:22)
-
SwiftData:
- History Tokens: SwiftData uses history tokens to track changes in the data store. This allows apps to resume long-running queries between relaunches and eliminate duplicated events. The state is needed to uniquely identify your position in the stream of transactions.
- Track model changes with SwiftData history (00:01:13)
- Track model changes with SwiftData history (00:02:16)
-
Core Location:
- Session Lifecycle: Core Location keeps track of each outstanding API object and resumes or relaunches the app into the background when new information is ready for delivery. This ensures that the app can continue to act on location updates even if it was terminated.
- What’s new in location authorization (00:11:41)
- What’s new in location authorization (00:12:27)
These sessions provide a comprehensive overview of how state restoration is handled across different Apple technologies presented at WWDC.

Meet FinanceKit
Learn how FinanceKit lets your financial management apps seamlessly and securely share on-device data from Apple Cash, Apple Card, and more, with user consent and control. Find out how to request one-time and ongoing access to accounts, transactions, and balances — and how to build great experiences for iOS and iPadOS.

What’s new in location authorization
Location authorization is turning 2.0. Learn about new recommendations and techniques to get the authorization you need, and a new system of diagnostics that can let you know when an authorization goal can’t be met.

Bring your machine learning and AI models to Apple silicon
Learn how to optimize your machine learning and AI models to leverage the power of Apple silicon. Review model conversion workflows to prepare your models for on-device deployment. Understand model compression techniques that are compatible with Apple silicon, and at what stages in your model deployment workflow you can apply them. We’ll also explore the tradeoffs between storage size, latency, power usage and accuracy.