shouldDefer
A Boolean value indicating whether your app should stop performing background activity and resume at a more optimal time.
Declaration
var shouldDefer: Bool { get }Discussion
Your app can check the shouldDefer property while executing scheduled background activity. If this property contains a value of 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. 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 and Configure Scheduler Properties.