---
title: "value(forKey:)"
framework: quartzcore
role: symbol
role_heading: Type Method
path: "quartzcore/catransaction/value(forkey:)"
---

# value(forKey:)

Returns the arbitrary keyed-data specified by the given key.

## Declaration

```swift
class func value(forKey key: String) -> Any?
```

## Parameters

- `key`: The name of one of the receiver’s properties.

## Return Value

Return Value The value for the data specified by the key.

## Discussion

Discussion Nested transactions have nested data scope. Requesting a value for a key first searches the innermost scope, then the enclosing transactions.

## See Also

### Getting and Setting Transaction Properties

- [setValue(_:forKey:)](quartzcore/catransaction/setvalue(_:forkey:).md)
