<!--
{
  "availability" : [
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSBackgroundActivityScheduler/shouldDefer",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSBackgroundActivityScheduler(py)shouldDefer"
  },
  "title" : "shouldDefer"
}
-->

# shouldDefer

A Boolean value indicating whether your app should stop performing background activity and resume at a more optimal time.

```
var shouldDefer: Bool { get }
```

## Discussion

Your app can check the `shouldDefer` property while executing scheduled background activity. If this property contains a value of <doc://com.apple.documentation/documentation/Swift/true>, system conditions have changed since the time the activity started and deferral is recommended. For example, perhaps the user unplugged the Mac and it’s now running on battery power. In this case, your app should finish what it’s currently doing, save its state, and invoke its completion handler with a value of [`NSBackgroundActivityScheduler.Result.deferred`](/documentation/Foundation/NSBackgroundActivityScheduler/Result/deferred). The system will invoke your activity again at a more optimal time, and your app can restore its previous state and resume where it left off. See [`Detect Whether to Defer Activity`](/documentation/Foundation/NSBackgroundActivityScheduler#Detect-Whether-to-Defer-Activity) and [`Configure Scheduler Properties`](/documentation/Foundation/NSBackgroundActivityScheduler#Configure-Scheduler-Properties).

## See Also

[`NSBackgroundActivityScheduler.Result`](/documentation/Foundation/NSBackgroundActivityScheduler/Result)

These constants indicate whether background activity has been completed successfully or whether additional processing should be deferred until a more optimal time.



---

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)