---
title: BGTaskScheduler
framework: backgroundtasks
role: symbol
role_heading: Class
path: backgroundtasks/bgtaskscheduler
---

# BGTaskScheduler

A class for scheduling tasks that add background support to your app’s most critical work.

## Declaration

```swift
class BGTaskScheduler
```

## Mentioned in

Performing long-running tasks on iOS and iPadOS

## Overview

Overview Background tasks give your app a way to run code even when the app is suspended: To register, schedule, and run tasks in the background, see Using background tasks to update your app. To submit work in the foreground that can finish even if the app moves to the background, see Performing long-running tasks on iOS and iPadOS.

## Topics

### Getting the shared task scheduler

- [shared](backgroundtasks/bgtaskscheduler/shared.md)

### Checking task requirements

- [supportedResources](backgroundtasks/bgtaskscheduler/supportedresources.md)

### Scheduling a task

- [register(forTaskWithIdentifier:using:launchHandler:)](backgroundtasks/bgtaskscheduler/register(fortaskwithidentifier:using:launchhandler:).md)
- [submit(_:)](backgroundtasks/bgtaskscheduler/submit(_:).md)

### Canceling a task

- [cancel(taskRequestWithIdentifier:)](backgroundtasks/bgtaskscheduler/cancel(taskrequestwithidentifier:).md)
- [cancelAllTaskRequests()](backgroundtasks/bgtaskscheduler/cancelalltaskrequests().md)

### Getting all scheduled tasks

- [getPendingTaskRequests(completionHandler:)](backgroundtasks/bgtaskscheduler/getpendingtaskrequests(completionhandler:).md)

### Handling errors

- [BGTaskScheduler.Error](backgroundtasks/bgtaskscheduler/error.md)
- [BGTaskScheduler.Error.Code](backgroundtasks/bgtaskscheduler/error/code.md)
- [errorDomain](backgroundtasks/bgtaskscheduler/errordomain.md)

### Instance Methods

- [submitTaskRequest(_:completionHandler:)](backgroundtasks/bgtaskscheduler/submittaskrequest(_:completionhandler:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.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

### Essentials

- [Background Tasks updates](updates/backgroundtasks.md)
- [BGTask](backgroundtasks/bgtask.md)
