How to reload widget's UI?

Asked on 2025-06-16

1 search

To reload a widget's UI, 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 frequently changing data, 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 the 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 method is not budgeted by the system since it is called when 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 the needs of your widget. For more details, you can refer to the session What’s new in widgets (18:12).