Begins scheduling the background activity.
- macOS 10.10+
A block of code to execute when the scheduler runs. This block will be called on a serial background queue appropriate for the level of quality of service specified. See
When your block is called, it’s passed a completion handler as an argument. Configure the block to invoke this handler, passing it a result of type
NSBackground to indicate whether the activity finished (
NSBackground) or should be deferred (
NSBackground) and rescheduled for a later time. Failure to invoke the completion handler results in the activity not being rescheduled. For work that will be deferred and rescheduled, the block may optionally adjust scheduler properties, such as
tolerance, before calling the completion handler. See Schedule Activity with scheduleWithBlock:.