---
title: WKSnapshotRefreshBackgroundTask
framework: watchkit
role: symbol
role_heading: Class
path: watchkit/wksnapshotrefreshbackgroundtask
---

# WKSnapshotRefreshBackgroundTask

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

## Declaration

```swift
class WKSnapshotRefreshBackgroundTask
```

## Mentioned in

Preparing to take your watchOS app’s snapshot

## Overview

Overview 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. Don’t subclass or create instances of this class. Instead, schedule a background snapshot refresh task by calling scheduleSnapshotRefresh(withPreferredDate:userInfo:scheduledCompletion:). When the system triggers this task, it launches your app in the background, instantiates a WKSnapshotRefreshBackgroundTask object, and passes the task object to your app delegate’s handle(_:) method. note: In watchOS 9 and later, SwiftUI Background tasks are the preferred way to handle background tasks and interactions. For more information, backgroundTask(_:action:). 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 when: Your device starts up Your app updates the complication timeline The user interacts with one of the apps notifications The app transitions from the foreground to the background One hour passes after the user’s last interaction with the app, then the returnToGlanceableUI property is set to true These requests don’t cancel or replace any of your scheduled requests.

## Topics

### Completing the background task

- [setTaskCompleted(restoredDefaultState:estimatedSnapshotExpiration:userInfo:)](watchkit/wksnapshotrefreshbackgroundtask/settaskcompleted(restoreddefaultstate:estimatedsnapshotexpiration:userinfo:).md)

### Instance properties

- [reasonForSnapshot](watchkit/wksnapshotrefreshbackgroundtask/reasonforsnapshot.md)
- [WKSnapshotReason](watchkit/wksnapshotreason.md)
- [returnToDefaultState](watchkit/wksnapshotrefreshbackgroundtask/returntodefaultstate.md)

## Relationships

### Inherits From

- [WKRefreshBackgroundTask](watchkit/wkrefreshbackgroundtask.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Background tasks

- [Using background tasks](watchkit/using-background-tasks.md)
- [Preparing to take your watchOS app’s snapshot](watchkit/preparing-to-take-your-watchos-app-s-snapshot.md)
- [WKApplicationRefreshBackgroundTask](watchkit/wkapplicationrefreshbackgroundtask.md)
- [WKURLSessionRefreshBackgroundTask](watchkit/wkurlsessionrefreshbackgroundtask.md)
- [WKWatchConnectivityRefreshBackgroundTask](watchkit/wkwatchconnectivityrefreshbackgroundtask.md)
- [WKBluetoothAlertRefreshBackgroundTask](watchkit/wkbluetoothalertrefreshbackgroundtask.md)
- [WKIntentDidRunRefreshBackgroundTask](watchkit/wkintentdidrunrefreshbackgroundtask.md)
- [WKRelevantShortcutRefreshBackgroundTask](watchkit/wkrelevantshortcutrefreshbackgroundtask.md)
- [WKRefreshBackgroundTask](watchkit/wkrefreshbackgroundtask.md)
