---
title: "value(forAnimatedKey:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uicollectionviewtransitionlayout/value(foranimatedkey:)"
---

# value(forAnimatedKey:)

Returns the most recently set value for the specified key.

## Declaration

```swift
func value(forAnimatedKey key: String) -> CGFloat
```

## Parameters

- `key`: A key whose value you set using the doc://com.apple.uikit/documentation/UIKit/UICollectionViewTransitionLayout/updateValue(_:forAnimatedKey:) method.

## Return Value

Return Value The last value set for the key.

## Discussion

Discussion Use this method to retrieve floating-point values that are useful when laying out the contents of your collection view. The key you specify is a string that you define and that has some meaning to your implementation. At points during an interactive transition, you can assign new values to that key using the updateValue(_:forAnimatedKey:) method.

## See Also

### Updating the transition information

- [transitionProgress](uikit/uicollectionviewtransitionlayout/transitionprogress.md)
- [updateValue(_:forAnimatedKey:)](uikit/uicollectionviewtransitionlayout/updatevalue(_:foranimatedkey:).md)
