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

# QCPlugIn

A base class to subclass for writing custom patches.

```
class QCPlugIn
```

## Overview

The `QCPlugIn` class provides the base class to subclass for writing custom  Quartz Composer patches. You implement a custom patch by subclassing `QCPlugIn`, overriding the appropriate methods, packaging the code as an `NSBundle` object, and installing the bundle in the appropriate location. A bundle can contain more than one subclass  of `QCPlugIn`, allowing you to provide a suite of custom patches in one bundle. [Quartz Composer Custom Patch Programming Guide](https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/QuartzComposer_Patch_PlugIn_ProgGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40004787) provides detailed instructions on how to create and package a custom patch. *QCPlugIn Class Reference* supplements the information in the programming guide.

The methods related to the executing the custom patch (called when the Quartz Composer engine is rendering) are passed an opaque object that conforms to the [`QCPlugInContext`](/documentation/Quartz/QCPlugInContext) protocol. This object represents the execution context of the `QCPlugIn` object. You should not retain the execution context or use it outside of the scope of the execution method that it is passed to.

## Topics

### Defining the Characteristics of a Custom Patch

[`+  executionMode`](/documentation/Quartz/QCPlugIn/executionMode())

Returns the execution mode of the custom patch.

[`+  timeMode`](/documentation/Quartz/QCPlugIn/timeMode())

Returns the time mode for the custom patch.

### Executing a Custom Patch

[`-  execute:atTime:withArguments:`](/documentation/Quartz/QCPlugIn/execute(_:atTime:withArguments:))

Performs the processing or rendering tasks appropriate for the custom patch.

### Performing Custom Tasks During Execution

[`-  startExecution:`](/documentation/Quartz/QCPlugIn/startExecution(_:))

Allows you to perform custom setup tasks before the Quartz Composer engine starts rendering.

[`-  enableExecution:`](/documentation/Quartz/QCPlugIn/enableExecution(_:))

Allows you to perform custom tasks when the execution of the `QCPlugIn` object is resumed.

[`-  disableExecution:`](/documentation/Quartz/QCPlugIn/disableExecution(_:))

Allows you to perform custom tasks when the execution of the `QCPlugIn` object is paused.

[`-  stopExecution:`](/documentation/Quartz/QCPlugIn/stopExecution(_:))

Allows you to perform custom tasks when the `QCPlugIn` object stops executing.

### Defining Patch and Property Port Attributes

[`+  attributes`](/documentation/Quartz/QCPlugIn/attributes())

Returns a dictionary that contains strings for the user interface that describe the custom patch.

[`+  attributesForPropertyPortWithKey:`](/documentation/Quartz/QCPlugIn/attributesForPropertyPort(withKey:))

Returns a dictionary that contains strings for the user interface that describe the optional attributes for ports created from properties.

### Defining Internal Settings

[`-  createViewController`](/documentation/Quartz/QCPlugIn/createViewController())

Creates and returns a view controller for the Settings pane of a custom patch.

[`+  plugInKeys`](/documentation/Quartz/QCPlugIn/plugInKeys())

Returns the keys for the internal settings of a custom patch.

### Supporting Saving and Retrieving Internal Settings

[`-  serializedValueForKey:`](/documentation/Quartz/QCPlugIn/serializedValue(forKey:))

A method implemented to override serialization.

[`-  setSerializedValue:forKey:`](/documentation/Quartz/QCPlugIn/setSerializedValue(_:forKey:))

Provides custom deserialization for patch internal settings that were previously serialized using the method [`serializedValue(forKey:)`](/documentation/Quartz/QCPlugIn/serializedValue(forKey:)).

### Adding Ports Dynamically

[`-  addInputPortWithType:forKey:withAttributes:`](/documentation/Quartz/QCPlugIn/addInputPort(withType:forKey:withAttributes:))

Adds an input port of the specified type and associates a key and attributes with the port.

[`-  removeInputPortForKey:`](/documentation/Quartz/QCPlugIn/removeInputPort(forKey:))

Removes the input port for a given key.

[`-  addOutputPortWithType:forKey:withAttributes:`](/documentation/Quartz/QCPlugIn/addOutputPort(withType:forKey:withAttributes:))

Adds an output port of the specified type and associates a key and attributes with the port.

[`-  removeOutputPortForKey:`](/documentation/Quartz/QCPlugIn/removeOutputPort(forKey:))

Removes the output port for a given key.

### Getting and Setting Port Values

[`-  didValueForInputKeyChange:`](/documentation/Quartz/QCPlugIn/didValue(forInputKeyChange:))

Returns whether the input port value changed since the last execution of the custom patch.

[`-  valueForInputKey:`](/documentation/Quartz/QCPlugIn/value(forInputKey:))

Returns the current value for an input port.

[`-  setValue:forOutputKey:`](/documentation/Quartz/QCPlugIn/setValue(_:forOutputKey:))

Sets the value of an output port.

### Loading Bundle and Custom Patches Manually

[`+  loadPlugInAtPath:`](/documentation/Quartz/QCPlugIn/load(atPath:))

Loads a Quartz Composer plug-in bundle from the specified path.

[`+  registerPlugInClass:`](/documentation/Quartz/QCPlugIn/registerClass(_:))

Registers a `QCPlugIn` subclass.

### Ordering Property Ports

[`+  sortedPropertyPortKeys`](/documentation/Quartz/QCPlugIn/sortedPropertyPortKeys())

Returns and array of property port keys in the order you want them to appear in the user interface.

### Constants

[Patch Attributes](/documentation/Quartz/patch-attributes)

Attributes for custom patches.

[Input and Output Port Attributes](/documentation/Quartz/input-and-output-port-attributes)

Attributes for input and output ports.

[Port Input and Output Types](/documentation/Quartz/port-input-and-output-types)

Data types for input and output ports.

[Pixel Formats](/documentation/Quartz/pixel-formats)

Supported image pixel formats.

[Execution Arguments](/documentation/Quartz/execution-arguments)

Arguments to the method [`execute(_:atTime:withArguments:)`](/documentation/Quartz/QCPlugIn/execute(_:atTime:withArguments:)).

[`QCPlugInExecutionMode`](/documentation/Quartz/QCPlugInExecutionMode)

Execution modes for custom patches.

[`QCPlugInTimeMode`](/documentation/Quartz/QCPlugInTimeMode)

Time modes for custom patches.

## See Also

  [Quartz Composer Custom Patch Programming Guide](https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/QuartzComposer_Patch_PlugIn_ProgGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40004787)

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CVarArg`](/documentation/Swift/CVarArg)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)