---
title: QCPlugIn
framework: quartz
role: symbol
role_heading: Class
path: quartz/qcplugin
---

# QCPlugIn

A base class to subclass for writing custom patches.

## Declaration

```swift
class QCPlugIn
```

## Overview

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 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 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()](quartz/qcplugin/executionmode().md)
- [timeMode()](quartz/qcplugin/timemode().md)

### Executing a Custom Patch

- [execute(_:atTime:withArguments:)](quartz/qcplugin/execute(_:attime:witharguments:).md)

### Performing Custom Tasks During Execution

- [startExecution(_:)](quartz/qcplugin/startexecution(_:).md)
- [enableExecution(_:)](quartz/qcplugin/enableexecution(_:).md)
- [disableExecution(_:)](quartz/qcplugin/disableexecution(_:).md)
- [stopExecution(_:)](quartz/qcplugin/stopexecution(_:).md)

### Defining Patch and Property Port Attributes

- [attributes()](quartz/qcplugin/attributes().md)
- [attributesForPropertyPort(withKey:)](quartz/qcplugin/attributesforpropertyport(withkey:).md)

### Defining Internal Settings

- [createViewController()](quartz/qcplugin/createviewcontroller().md)
- [plugInKeys()](quartz/qcplugin/pluginkeys().md)

### Supporting Saving and Retrieving Internal Settings

- [serializedValue(forKey:)](quartz/qcplugin/serializedvalue(forkey:).md)
- [setSerializedValue(_:forKey:)](quartz/qcplugin/setserializedvalue(_:forkey:).md)

### Adding Ports Dynamically

- [addInputPort(withType:forKey:withAttributes:)](quartz/qcplugin/addinputport(withtype:forkey:withattributes:).md)
- [removeInputPort(forKey:)](quartz/qcplugin/removeinputport(forkey:).md)
- [addOutputPort(withType:forKey:withAttributes:)](quartz/qcplugin/addoutputport(withtype:forkey:withattributes:).md)
- [removeOutputPort(forKey:)](quartz/qcplugin/removeoutputport(forkey:).md)

### Getting and Setting Port Values

- [didValue(forInputKeyChange:)](quartz/qcplugin/didvalue(forinputkeychange:).md)
- [value(forInputKey:)](quartz/qcplugin/value(forinputkey:).md)
- [setValue(_:forOutputKey:)](quartz/qcplugin/setvalue(_:foroutputkey:).md)

### Loading Bundle and Custom Patches Manually

- [load(atPath:)](quartz/qcplugin/load(atpath:).md)
- [registerClass(_:)](quartz/qcplugin/registerclass(_:).md)

### Ordering Property Ports

- [sortedPropertyPortKeys()](quartz/qcplugin/sortedpropertyportkeys().md)

### Constants

- [Patch Attributes](quartz/patch-attributes.md)
- [Input and Output Port Attributes](quartz/input-and-output-port-attributes.md)
- [Port Input and Output Types](quartz/port-input-and-output-types.md)
- [Pixel Formats](quartz/pixel-formats.md)
- [Execution Arguments](quartz/execution-arguments.md)
- [QCPlugInExecutionMode](quartz/qcpluginexecutionmode.md)
- [QCPlugInTimeMode](quartz/qcplugintimemode.md)

### Instance Methods

- [executionTime(for:atTime:withArguments:)](quartz/qcplugin/executiontime(for:attime:witharguments:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Related Documentation

- [Quartz Composer Custom Patch Programming Guide](apple-archive/documentation/GraphicsImaging/Conceptual/QuartzComposer_Patch_PlugIn_ProgGuide/Introduction.md)

### Classes

- [QCComposition](quartz/qccomposition.md)
- [QCCompositionLayer](quartz/qccompositionlayer.md)
- [QCCompositionParameterView](quartz/qccompositionparameterview.md)
- [QCCompositionPickerPanel](quartz/qccompositionpickerpanel.md)
- [QCCompositionPickerView](quartz/qccompositionpickerview.md)
- [QCCompositionRepository](quartz/qccompositionrepository.md)
- [QCPatchController](quartz/qcpatchcontroller.md)
- [QCPlugInViewController](quartz/qcpluginviewcontroller.md)
- [QCRenderer](quartz/qcrenderer.md)
- [QCView](quartz/qcview.md)
