---
title: "value(forInputKey:)"
framework: quartz
role: symbol
role_heading: Instance Method
path: "quartz/qccompositionrenderer/value(forinputkey:)"
---

# value(forInputKey:)

Returns the value for an input port of a composition.

## Declaration

```swift
func value(forInputKey key: String!) -> Any!
```

## Parameters

- `key`: The key associated with an input port for the root patch of a composition. This method throws an exception if key is invalid.

## Return Value

Return Value The value. The data type of returned value depends on the type of the input port. See QCPortAttributeTypeKey for more information.

## See Also

### Passing and Retrieving Values From a Composition

- [setValue(_:forInputKey:)](quartz/qccompositionrenderer/setvalue(_:forinputkey:).md)
- [value(forOutputKey:)](quartz/qccompositionrenderer/value(foroutputkey:).md)
- [value(forOutputKey:ofType:)](quartz/qccompositionrenderer/value(foroutputkey:oftype:).md)
