<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Dispatch",
  "identifier" : "/documentation/Dispatch/DispatchQoS",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Dispatch"
    ],
    "preciseIdentifier" : "s:8Dispatch0A3QoSV"
  },
  "title" : "DispatchQoS"
}
-->

# DispatchQoS

The quality of service, or the execution priority, to apply to tasks.

```
struct DispatchQoS
```

## Overview

A quality-of-service (QoS) class categorizes work to perform on a [`DispatchQueue`](/documentation/Dispatch/DispatchQueue). By specifying the quality of a task, you indicate its importance to your app. When scheduling tasks, the system prioritizes those that have higher service classes.

Because higher priority work is performed more quickly and with more resources than lower priority work, it typically requires more energy than lower priority work. Accurately specifying appropriate QoS classes for the work your app performs ensures that your app is responsive and energy efficient.

## Topics

### Getting the Predefined QoS Objects

[`userInteractive`](/documentation/Dispatch/DispatchQoS/userInteractive)

The quality-of-service class for user-interactive tasks, such as animations, event handling, or updates to your app’s user interface.

[`userInitiated`](/documentation/Dispatch/DispatchQoS/userInitiated)

The quality-of-service class for tasks that prevent the user from actively using your app.

[`default`](/documentation/Dispatch/DispatchQoS/default)

The default quality-of-service class.

[`utility`](/documentation/Dispatch/DispatchQoS/utility)

The quality-of-service class for tasks that the user does not track actively.

[`background`](/documentation/Dispatch/DispatchQoS/background)

The quality-of-service class for maintenance or cleanup tasks that you create.

[`unspecified`](/documentation/Dispatch/DispatchQoS/unspecified)

The absence of a quality-of-service class.

### Creating a QoS Structure

[`init(qosClass:relativePriority:)`](/documentation/Dispatch/DispatchQoS/init(qosClass:relativePriority:))

Creates a new `DispatchQoS` object with the specified QoS class and relative priority.

[`DispatchQoS.QoSClass`](/documentation/Dispatch/DispatchQoS/QoSClass-swift.enum)

Quality-of-service classes that specify the priorities for executing tasks.

### Getting the QoS Attributes

[`qosClass`](/documentation/Dispatch/DispatchQoS/qosClass-swift.property)

The quality-of-service class.

[`relativePriority`](/documentation/Dispatch/DispatchQoS/relativePriority)

The priority of a quality of service relative to others with the same class.

### Operator Functions



---

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)
