How to manage state
Asked on 09/06/2024
1 search
To manage state in the context of Apple's WWDC sessions, there are several approaches depending on the technology or framework you are using:
-
Core ML: In the session Deploy machine learning and AI models on-device with Core ML, it is discussed how Core ML now supports stateful models. This allows you to manage state more efficiently by using Core ML states instead of handling key-value caches manually. This can reduce overhead and improve inference efficiency.
-
SwiftUI: In the session SwiftUI essentials, SwiftUI provides a way to manage state using the
@State
property wrapper. This allows SwiftUI to manage the storage of the state and provide it back for the view to read and write. A@Binding
can be used to create a two-way reference to the state of another view, allowing for dynamic updates and interactions. -
Core Spotlight: In the session Support semantic search with Core Spotlight, client state is used to manage large catalogs of items and maintain data integrity between your app and Spotlight. This helps in preventing over-donation of items and ensures that your searchable content stays up to date.
These sessions provide insights into different ways of managing state across various Apple technologies, each tailored to specific use cases and frameworks.

Design Live Activities for Apple Watch
Starting in watchOS 11, Live Activities from your iOS app will automatically appear in the Smart Stack on a connected Apple Watch. Learn how to optimize the layout of your Live Activity for the wrist, and provide the right level of information and interactivity at the right time.

Deploy machine learning and AI models on-device with Core ML
Learn new ways to optimize speed and memory performance when you convert and run machine learning and AI models through Core ML. We’ll cover new options for model representations, performance insights, execution, and model stitching which can be used together to create compelling and private on-device experiences.

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.