Use the following approaches to optimize the widget refreshed:
-
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.
-
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.
- Choose the most appropriate refresh policy for the information being shown, as described in the preceding section.
- Call
reloadTimelines(ofKind:)
only when information the widget is currently displaying changes.