---
title: "getSpecific(key:)"
framework: dispatch
role: symbol
role_heading: Type Method
path: "dispatch/dispatchqueue/getspecific(key:)-swift.type.method"
---

# getSpecific(key:)

Returns the value for the key associated with the current execution context.

## Declaration

```swift
@preconcurrency class func getSpecific<T>(key: DispatchSpecificKey<T>) -> T? where T : Sendable
```

## Parameters

- `key`: The key associated with the dispatch queue.

## See Also

### Getting and Setting Contextual Data

- [setSpecific(key:value:)](dispatch/dispatchqueue/setspecific(key:value:).md)
- [getSpecific(key:)](dispatch/dispatchqueue/getspecific(key:)-swift.method.md)
- [DispatchSpecificKey](dispatch/dispatchspecifickey.md)
