<!--
{
  "availability" : [
    "macOS: 10.4.0 - 10.15.0"
  ],
  "documentType" : "symbol",
  "framework" : "Quartz",
  "identifier" : "/documentation/Quartz/QCPlugIn/setValue(_:forOutputKey:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Quartz"
    ],
    "preciseIdentifier" : "c:objc(cs)QCPlugIn(im)setValue:forOutputKey:"
  },
  "title" : "setValue(_:forOutputKey:)"
}
-->

# setValue(_:forOutputKey:)

Sets the value of an output port.

```
func setValue(_ value: Any!, forOutputKey key: String!) -> Bool
```

## Parameters

`value`

The value to associate with the specified key.

`key`

The key associated with the output port whose value you want to set.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if successful; <doc://com.apple.documentation/documentation/Swift/false>  if called outside of the [`execute(_:atTime:withArguments:)`](/documentation/Quartz/QCPlugIn/execute(_:atTime:withArguments:)) method.

## Discussion

You call this method from within your [`execute(_:atTime:withArguments:)`](/documentation/Quartz/QCPlugIn/execute(_:atTime:withArguments:)) method to set the output values of your custom patch.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)