---
title: "value(forOutputKey:ofType:)"
framework: quartz
role: symbol
role_heading: Instance Method
path: "quartz/qccompositionrenderer/value(foroutputkey:oftype:)"
---

# value(forOutputKey:ofType:)

Returns the current value on an output port (identified by its key) of the root patch of the composition.

## Declaration

```swift
func value(forOutputKey key: String!, ofType type: String!) -> Any!
```

## Parameters

- `key`: The key associated with an output port for the root patch of a composition. This method throws an exception if key is invalid.
- `type`: A string that specifies the class.

## Return Value

Return Value The value.

## Discussion

Discussion The value type depends on the type of the port type, as shown in the following table  |   |   |   |   |   |

## See Also

### Passing and Retrieving Values From a Composition

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