A unique token that identifies a request to run in the background.


struct UIBackgroundTaskIdentifier


Invalid Identifier

static let invalid: UIBackgroundTaskIdentifier

A token indicating an invalid task request. This constant should be used to initialize variables or to check for errors.


See Also

Managing Background Execution

var backgroundRefreshStatus: UIBackgroundRefreshStatus

Indicates whether the app can refresh content when running in the background.

enum UIBackgroundRefreshStatus

Constants indicating whether background execution is enabled for the app.

class let backgroundRefreshStatusDidChangeNotification: NSNotification.Name

Posted when the app’s status for downloading content in the background changes.

func beginBackgroundTask(withName: String?, expirationHandler: (() -> Void)?) -> UIBackgroundTaskIdentifier

Marks the beginning of a new long-running background task with the specified name.

func endBackgroundTask(UIBackgroundTaskIdentifier)

Marks the end of a specific long-running background task.

var backgroundTimeRemaining: TimeInterval

The amount of time the app has to run in the background.