<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/Task/escalatePriority(to:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:ScT16escalatePriority2toyScP_tF"
  },
  "title" : "escalatePriority(to:)"
}
-->

# escalatePriority(to:)

Manually escalate the task `priority` of this task to the `newPriority`.

```
func escalatePriority(to newPriority: TaskPriority)
```

## Parameters

`newPriority`

the new priority the task should continue executing on

## Discussion> Warning: This API should rarely be used, and instead you can rely on
> structured concurrency and implicit priority escalation which happens
> when a higher priority task awaits on a result of a lower priority task.
> 
> I.e. using `await` on the target task usually is the correct way to
> escalate the target task to the current priority of the calling task,
> especially because in such setup if the waiting task gets escalated,
> the waited on task would be escalated automatically as well.

The concurrency runtime is free to interpret and handle escalation
depending on platform characteristics.

Priority escalation is propagated to child tasks of the waited-on task,
and will trigger any priority escalation handlers, if any were registered.

Escalation can only *increase* the priority of a task, and
de-escalating priority is not supported.

This method can be called from any task or thread.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)