An abstract class representing a task that’s run while the app is in the background.
SDKs
- iOS 13.0+
- Mac Catalyst 13.0+
- tvOS 13.0+
Framework
- Background
Tasks
Declaration
class BGTask : NSObject
An abstract class representing a task that’s run while the app is in the background.
SDKs
Framework
class BGTask : NSObject
var identifier: String
The string identifier of the task.
var expiration Handler: (() -> Void)?
A handler called shortly before the task’s background time expires.
func set Task Completed(success: Bool)
Informs the background task scheduler that the task is complete.
class BGProcessing Task
A time-consuming processing task that runs while the app is in the background.
class BGApp Refresh Task
An object representing a short task typically used to refresh content that’s run while the app is in the background.