Background Task Cancellation

Constants that indicate why a background task was canceled.


These values are used in conjunction with the NSURLErrorBackgroundTaskCancelledReasonKey key in an NSError object’s userInfo dictionary.


Cancellation Reasons

var NSURLErrorCancelledReasonUserForceQuitApplication: Int

The operation was canceled because the user forced the app to quit.

var NSURLErrorCancelledReasonBackgroundUpdatesDisabled: Int

The operation was canceled because background updates are disabled. See Background Execution for more information.

var NSURLErrorCancelledReasonInsufficientSystemResources: Int

The operation was canceled due to insufficient system resources.

See Also

Handling Errors

NSURLSession-Specific NSError userInfo Dictionary Keys

Keys used in conjunction with NSError objects returned by the NSURLSession API.