How to update widget's data?

Generated on 3/3/2025

1 search

To update a widget's data, you can use several methods depending on the context and requirements of your app. Here are some key points from the WWDC sessions:

  1. Reloading Controls: When the system needs to reload your control, it runs the body of the control in your widget extension process to ask for your control's current value and generate the control's content. This can happen when a control action is performed, when your app requests a reload on demand, or when a push notification invalidates your control. (Extend your app’s controls across the system)

  2. Using Value Providers: If your widget's state is managed off-device, such as on a server, you can use a value provider to fetch the current state asynchronously. This allows your widget to reflect changes made from different devices. (Extend your app’s controls across the system)

  3. Interactive Widgets: In iOS 17 and macOS 14, interactive widgets allow users to perform actions directly from the widget without opening the app. This can include buttons and toggles that update the widget's state. (What’s new in watchOS 11)

  4. Relevance and Context: You can use relevant contexts to update your widget's data based on specific conditions, such as time of day or location. This helps ensure that your widget appears when it is most useful. (What’s new in watchOS 11)

These methods provide flexibility in how you update and manage the data displayed in your widgets, ensuring they remain relevant and up-to-date for users.

Bring your Live Activity to Apple Watch

Bring your Live Activity to Apple Watch

Bring Live Activities into the Smart Stack on Apple Watch with iOS 18 and watchOS 11. We’ll cover how Live Activities are presented on Apple Watch, as well as how you can enhance their presentation for the Smart Stack. We’ll also explore additional considerations to ensure Live Activities on Apple Watch always present up-to-date information.

What’s new in watchOS 11

What’s new in watchOS 11

Explore new opportunities on Apple Watch, including bringing Double Tap support to your watchOS app, making your Smart Stack widgets even more relevant and interactive, and displaying your iOS Live Activities in the Smart Stack.

Platforms State of the Union

Platforms State of the Union

Discover the newest advancements on Apple platforms.

Bring your app’s core features to users with App Intents

Bring your app’s core features to users with App Intents

Learn the principles of the App Intents framework, like intents, entities, and queries, and how you can harness them to expose your app’s most important functionality right where people need it most. Find out how to build deep integration between your app and the many system features built on top of App Intents, including Siri, controls and widgets, Apple Pencil, Shortcuts, the Action button, and more. Get tips on how to build your App Intents integrations efficiently to create the best experiences in every surface while still sharing code and core functionality.

What’s new in SwiftUI

What’s new in SwiftUI

Learn how you can use SwiftUI to build great apps for any Apple platform. Explore a fresh new look and feel for tabs and documents on iPadOS. Improve your window management with new windowing APIs, and gain more control over immersive spaces and volumes in your visionOS apps. We’ll also take you through other exciting refinements that help you make expressive charts, customize and layout text, and so much more.

Catch up on accessibility in SwiftUI

Catch up on accessibility in SwiftUI

SwiftUI makes it easy to build amazing experiences that are accessible to everyone. We’ll discover how assistive technologies understand and navigate your app through the rich accessibility elements provided by SwiftUI. We’ll also discuss how you can further customize these experiences by providing more information about your app’s content and interactions by using accessibility modifiers.

Extend your app’s controls across the system

Extend your app’s controls across the system

Bring your app’s controls to Control Center, the Lock Screen, and beyond. Learn how you can use WidgetKit to extend your app’s controls to the system experience. We’ll cover how you can to build a control, tailor its appearance, and make it configurable.

Meet the next generation of CarPlay architecture

Meet the next generation of CarPlay architecture

Dive into the architecture for the next generation of CarPlay. Learn how your vehicle system works with iPhone to create a single cohesive experience that showcases the best of your car and iPhone. Learn how UI is rendered and composited, and explore ways to configure and customize a special experience for each vehicle model. This session is intended for automakers and system developers interested in the next generation of CarPlay.