<!--
{
  "availability" : [
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WatchKit",
  "identifier" : "/documentation/WatchKit/WKRefreshBackgroundTask/expirationHandler",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "WatchKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WKRefreshBackgroundTask(py)expirationHandler"
  },
  "title" : "expirationHandler"
}
-->

# expirationHandler

A block that the system calls when the available runtime for a background task is about to expire.

```
var expirationHandler: (() -> Void)? { get set }
```

## Discussion

To respond when your background task is about to expire, assign a block to this property. In this block, clean up any running background tasks, and prepare for the system to suspend your app.

---

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)