How to reload widget's UI when I need it?

Asked on 06/16/2025

1 search

To reload a widget's UI when needed, you have several options available as discussed in the session "What’s new in widgets" from WWDC 2025:

  1. Scheduled Timeline Reloads: You can use the Timeline reload policy to update widgets at regular intervals. This is useful for widgets that need to display time-sensitive information like weather or stock prices. The system budgets these updates to maintain performance and battery life.

  2. Widget Center API: If a data change occurs within your app that should be reflected in its widget, you can use the Widget Center's reloadAllTimelines or reloadTimelines(ofKind:) methods. This tells WidgetKit that the widget's content is outdated and needs to be reloaded. This option is not budgeted by the system since it is called while the app is running.

  3. Widget Push Updates: For data changes that occur on a server or another device, you can use widget push updates. A server can send a push notification to APNS, which will tell WidgetKit to reload the app's widgets. These updates are budgeted to maintain performance and battery life.

These options can be used individually or in combination, depending on your widget's needs. For more detailed information, you can refer to the session What’s new in widgets (18:12).