---
title: BGProcessingTask
framework: backgroundtasks
role: symbol
role_heading: Class
path: backgroundtasks/bgprocessingtask
---

# BGProcessingTask

A time-consuming processing task that runs while the app is in the background.

## Declaration

```swift
class BGProcessingTask
```

## Mentioned in

Choosing Background Strategies for Your App

## Overview

Overview Use processing tasks for long data updates, processing data, and app maintenance. Although processing tasks can run for minutes, the system can interrupt the process. Add an expiration handler by setting expirationHandler for any required cleanup. Executing processing tasks requires setting the processing UIBackgroundModes capability. For information on setting this capability, see BGTaskScheduler. Processing tasks run only when the device is idle. The system terminates any background processing tasks running when the user starts using the device. Background refresh tasks aren’t affected.

## Relationships

### Inherits From

- [BGTask](backgroundtasks/bgtask.md)

### Inherited By

- [BGHealthResearchTask](backgroundtasks/bghealthresearchtask.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Background tasks

- [Using background tasks to update your app](uikit/using-background-tasks-to-update-your-app.md)
- [Refreshing and Maintaining Your App Using Background Tasks](backgroundtasks/refreshing-and-maintaining-your-app-using-background-tasks.md)
- [Choosing Background Strategies for Your App](backgroundtasks/choosing-background-strategies-for-your-app.md)
- [BGAppRefreshTask](backgroundtasks/bgapprefreshtask.md)
- [BGHealthResearchTask](backgroundtasks/bghealthresearchtask.md)
