<!--
{
  "availability" : [
    "watchOS: 4.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WatchKit",
  "identifier" : "/documentation/WatchKit/WKRefreshBackgroundTask/setTaskCompletedWithSnapshot(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WatchKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WKRefreshBackgroundTask(im)setTaskCompletedWithSnapshot:"
  },
  "title" : "setTaskCompletedWithSnapshot(_:)"
}
-->

# setTaskCompletedWithSnapshot(_:)

Marks the task as complete and indicates whether the system should take a new snapshot of the app.

```
func setTaskCompletedWithSnapshot(_ refreshSnapshot: Bool)
```

## Parameters

`refreshSnapshot`

A Boolean value that indicates whether the system should take a new snapshot of the app.

## Discussion

Call this method as soon as a nonsnapshot background task (any [`WKRefreshBackgroundTask`](/documentation/WatchKit/WKRefreshBackgroundTask) subclass except the [`WKSnapshotRefreshBackgroundTask`](/documentation/WatchKit/WKSnapshotRefreshBackgroundTask) class) is complete.

To update the app’s snapshot in response to the current task, pass <doc://com.apple.documentation/documentation/Swift/true>, and the system schedules an immediate snapshot. This request counts against the standard snapshot budget and overwrites any requests made using the [`scheduleSnapshotRefresh(withPreferredDate:userInfo:scheduledCompletion:)`](/documentation/WatchKit/WKExtension/scheduleSnapshotRefresh(withPreferredDate:userInfo:scheduledCompletion:)) method. As with all snapshots, your app receives a [`WKSnapshotRefreshBackgroundTask`](/documentation/WatchKit/WKSnapshotRefreshBackgroundTask) before the snapshot is taken.

The system provides your extension with a limited amount of time (on the order of seconds) to finish this task. If you do not call [`setTaskCompletedWithSnapshot(_:)`](/documentation/WatchKit/WKRefreshBackgroundTask/setTaskCompletedWithSnapshot(_:)) on the task, the system continues to run in the background until all available time is consumed, wasting battery power.

The system suspends the extension as soon as all background tasks are complete.

When completing a snapshot background task, you generally call the [`setTaskCompleted(restoredDefaultState:estimatedSnapshotExpiration:userInfo:)`](/documentation/WatchKit/WKSnapshotRefreshBackgroundTask/setTaskCompleted(restoredDefaultState:estimatedSnapshotExpiration:userInfo:))method and explicitly set the date for the next snapshot. You can call [`setTaskCompletedWithSnapshot(_:)`](/documentation/WatchKit/WKRefreshBackgroundTask/setTaskCompletedWithSnapshot(_:)) as a simpler alternative. If you pass <doc://com.apple.documentation/documentation/Swift/true>, the system schedules a new snapshot task in one hour. If you pass <doc://com.apple.documentation/documentation/Swift/false>, no snapshot is scheduled.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)