---
title: "submit(_:)"
framework: backgroundtasks
role: symbol
role_heading: Instance Method
path: "backgroundtasks/bgtaskscheduler/submit(_:)"
---

# submit(_:)

Submit a previously registered background task for execution.

## Declaration

```swift
func submit(_ taskRequest: BGTaskRequest) throws
```

## Parameters

- `taskRequest`: A background task request object specifying the task identifier and optional configuration information.

## Mentioned in

Performing long-running tasks on iOS and iPadOS Starting and Terminating Tasks During Development

## Discussion

Discussion Submitting a task request for an unexecuted task that’s already in the queue replaces the previous task request. There can be a total of 1 refresh task and 10 processing tasks scheduled at any time. Trying to schedule more tasks returns BGTaskScheduler.Error.Code.tooManyPendingTaskRequests.

## See Also

### Scheduling a task

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