A background task used to update your app’s user interface in preparation for a snapshot.


class WKSnapshotRefreshBackgroundTask : WKRefreshBackgroundTask


Using the methods of WKSnapshotRefreshBackgroundTask, you can push, pop, or present other interface controllers, and then update the content of the desired interface controller. The system automatically takes a snapshot of your user interface as soon as this task completes.

Do not subclass or create instances of this class. Instead, schedule a background snapshot refresh task by calling scheduleSnapshotRefresh(withPreferredDate:userInfo:scheduledCompletion:). When this task is triggered, the system launches your app in the background, instantiates a WKSnapshotRefreshBackgroundTask object, and passes the task object to your extension delegate’s handle(_:) method.

Background snapshot tasks are budgeted. In general, the system performs approximately one task per hour for each app in the dock (including the most recently used app). This budget is shared among all apps on the dock. The system performs multiple tasks an hour for each app with a complication on the active watch face. This budget is shared among all complications on the watch face. After you exhaust the budget, the system delays your requests until more time becomes available.

The system automatically schedules background snapshot request tasks in the following situations:

  • When your device starts up.

  • When your app updates the complication timeline.

  • When the user interacts with one of the apps notifications.

  • When the app transitions from the foreground to the background.

  • One hour after the user’s last interaction with the app. In this task, the returnToGlanceableUI property is set to true.

These requests do not cancel or replace any of your scheduled requests.


Instance Properties

var reasonForSnapshot: WKSnapshotReason

The reason for taking the upcoming snapshot.

enum WKSnapshotReason

The reason for a background snapshot task.

var returnToDefaultState: Bool

A Boolean value indicating that the app should return to its default state.



Conforms To

See Also

Background Tasks

Running watchOS Apps in the Background

Schedule and perform background tasks from within your app.

Playing Background Audio

Enable background audio in your app to provide a seamless playback experience.

Preparing to Take Your watchOS App’s Snapshot

Use snapshot background tasks to provide a timely, accurate snapshot of your app.

class WKRefreshBackgroundTask

The abstract superclass for WatchKit's other background task classes.

class WKApplicationRefreshBackgroundTask

A background task used to update your app’s state in the background.

class WKURLSessionRefreshBackgroundTask

A background task that helps you respond to URLSession background transfers.

class WKWatchConnectivityRefreshBackgroundTask

A background task used to receive background updates from the Watch Connectivity framework.

class WKIntentDidRunRefreshBackgroundTask

A background task used to update your app after a SiriKit intent runs.

class WKRelevantShortcutRefreshBackgroundTask

A background task used to periodically donate relevant Siri shortcuts.

Background Session Keys

Enable background sessions.