Instance Property

backgroundRefreshStatus

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

Declaration

var backgroundRefreshStatus: UIBackgroundRefreshStatus { get }

Discussion

You can use this property to determine whether Background App Refresh—an app's ability to open in the background to perform refresh tasks—is enabled, and warn the user if it is not. Don't warn the user if the value of this property is set to UIBackgroundRefreshStatus.restricted. A restricted user, such as one who is managed under parental controls, can't enable Background App Refresh.

Background App Refresh is disabled automatically when a device is operating in low-power mode. When this happens, the time available for performing background tasks is reduced to save power.

See Also

Managing Background Execution

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.

struct UIBackgroundTaskIdentifier

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

var backgroundTimeRemaining: TimeInterval

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