Generic Class

DispatchSpecificKey

A key associated with a specific contextual value on a dispatch queue.

Declaration

final class DispatchSpecificKey<T>

Overview

Access the value of a key using the setSpecific(key:value:) and getSpecific(key:) methods.

Topics

Creating a Key

See Also

Getting and Setting Contextual Data

func setSpecific<T>(key: DispatchSpecificKey<T>, value: T?)

Sets the key/value data for the specified dispatch queue.

func getSpecific<T>(key: DispatchSpecificKey<T>) -> T?

Returns the value for the key associated with this dispatch queue.

class func getSpecific<T>(key: DispatchSpecificKey<T>) -> T?

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