<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: -",
    "macOS: 10.10.0 -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Dispatch",
  "identifier" : "/documentation/Dispatch/DispatchWorkItem/init(qos:flags:block:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Dispatch"
    ],
    "preciseIdentifier" : "s:8Dispatch0A8WorkItemC3qos5flags5blockAcA0A3QoSV_AA0abC5FlagsVyyXLtcfc"
  },
  "title" : "init(qos:flags:block:)"
}
-->

# init(qos:flags:block:)

Creates a new dispatch work item from an existing block and assigns it the specified quality-of-service class.

```
init(qos: DispatchQoS = .unspecified, flags: DispatchWorkItemFlags = [], block: @escaping () -> Void)
```

## Parameters

`qos`

The quality-of-service class to use when prioritizing the work item’s execution. For a list of possible values, see [`DispatchQoS`](/documentation/Dispatch/DispatchQoS).

`flags`

Configuration flags for the work item. For a list of possible values, see [`DispatchWorkItemFlags`](/documentation/Dispatch/DispatchWorkItemFlags).

`block`

The block that performs the work.

## Discussion

Submit the returned dispatch work item to a queue to schedule it for execution in that queue. Dispatch queues may alter the specified quality-of-service level based on the specified `flags` and the quality-of-service level of the queue’s underlying threads. However, the queue never executes the block with a quality-of-service level lower than the one in the `qos` parameter.

You can also execute the dispatch work item directly in the current context by calling its [`perform()`](/documentation/Dispatch/DispatchWorkItem/perform()) method. When performing a work item directly, the system never executes the block with a quality-of-service level lower than the one in the `qos` parameter.

---

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)