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

# QCComposition

The `QCComposition` class represents a Quartz Composer composition that either:

```
class QCComposition
```

## Overview

- comes from the system-wide composition repository  (`/Library/Compositions` and `~/Library/Compositions`) where it can be accessed by any application through the methods of the [`QCCompositionRepository`](/documentation/Quartz/QCCompositionRepository) class
- is created from an arbitrary source (typically a file on disk) using one of its methods

This class cannot be subclassed.

A `QCComposition` object has the following information associated with it and that you can obtain by using the appropriate method of the `QCComposition` class:

- Attributes include the name and description of the composition, copyright information, and whether or not its provided by macOS (built-in).
- The protocols that the composition conforms to. A *composition protocol*  defines a set of required and optional input parameters and output results.

Many methods of the [`QCRenderer`](/documentation/Quartz/QCRenderer), [`QCCompositionLayer`](/documentation/Quartz/QCCompositionLayer), and [`QCView`](/documentation/Quartz/QCView) classes take a `QCComposition` object as a parameter.

## Topics

### Creating a Composition

[`+  compositionWithFile:`](/documentation/Quartz/QCComposition/init(file:))

Returns a composition object initialized with a Quartz Composer composition file.

[`+  compositionWithData:`](/documentation/Quartz/QCComposition/init(data:))

Returns a composition object  initialized with the contents of a Quartz Composer composition file.

### Getting Information About a Composition

[`-  attributes`](/documentation/Quartz/QCComposition/attributes())

Returns the attributes of the composition.

[`-  protocols`](/documentation/Quartz/QCComposition/protocols())

Returns the list of protocols to which the composition conforms.

[`-  identifier`](/documentation/Quartz/QCComposition/identifier())

Returns the unique and persistent identifier for the composition from the composition repository.

### Getting Port Keys

[`-  inputKeys`](/documentation/Quartz/QCComposition/inputKeys())

Returns an array listing the keys that identify the input ports of the root patch of the composition.

[`-  outputKeys`](/documentation/Quartz/QCComposition/outputKeys())

Returns an array listing the keys that identify the output ports of the root patch of the composition.

### Constants

[Attribute Keys](/documentation/Quartz/attribute-keys)

Attributes of a composition.

[Composition Categories](/documentation/Quartz/composition-categories)

Categories for compositions.

[Standard Protocol Input Keys](/documentation/Quartz/standard-protocol-input-keys)

Input ports of a composition.

[Standard Protocol Output Keys](/documentation/Quartz/standard-protocol-output-keys)

Output ports of a composition.

[Standard Protocols](/documentation/Quartz/standard-protocols)

Protocols for a composition.

## Relationships

### Conforms To

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

[`NSCopying`](/documentation/Foundation/NSCopying)

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

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

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

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

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

### 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)