My Profile Photo

Hao's Keeper


A blog to place memos


Keeping a Widget Up to Date

Use the following approaches to optimize the widget refreshed:

  1. Have the containing app prepare data for the widget in advance of when the widget needs it. Use a shared group container to store the data.

  2. Use background processing time in your app to keep shared data up to date. For more information, see Using background tasks to update your app.

  3. Choose the most appropriate refresh policy for the information being shown, as described in the preceding section.
  4. Call reloadTimelines(ofKind:) only when information the widget is currently displaying changes.