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

# QCCompositionLayer

A layer that loads, plays, and controls Quartz Composer compositions in a Core Animation layer hierarchy.

```
class QCCompositionLayer
```

## Overview

The composition tracks the Core Animation layer time and is rendered directly at the current dimensions of the [`QCCompositionLayer`](/documentation/Quartz/QCCompositionLayer) object.

An archived `QCCompositionLayer` object saves the composition that’s loaded at the time the layer is archived. It detects layer usage and pauses or resumes the composition appropriately. A `QCCompositionLayer` object starts rendering the composition automatically when the layer is placed in a visible layer hierarchy. The layer stops rendering when it is hidden or removed from the visible layer hierarchy.

You can pass data to the input ports, or retrieve data from the output ports, of the root patch of a composition by accessing the `patch` attribute of the `QCCompositionLayer` instance using methods provided by the [`QCCompositionRenderer`](/documentation/Quartz/QCCompositionRenderer) protocol.

> Note:
> You must not modify the `asynchronous` property of the superclass <doc://com.apple.documentation/documentation/QuartzCore/CAOpenGLLayer>.

## Topics

### Creating a Composition Layer

[`+  compositionLayerWithFile:`](/documentation/Quartz/QCCompositionLayer/compositionLayerWithFile:)

Creates and returns an instance of a composition layer using the Quartz Composer composition in the specified file.

[`+  compositionLayerWithComposition:`](/documentation/Quartz/QCCompositionLayer/compositionLayerWithComposition:)

Creates and returns an instance of a composition layer using the provided Quartz Composer composition.

[`-  initWithFile:`](/documentation/Quartz/QCCompositionLayer/init(file:))

Initializes and returns a composition layer using the Quartz Composer composition in the specified file.

[`-  initWithComposition:`](/documentation/Quartz/QCCompositionLayer/init(composition:))

Initializes and returns a  composition layer using the provided Quartz Composer composition.

### Getting the Composition

[`-  composition`](/documentation/Quartz/QCCompositionLayer/composition())

Returns the composition associated with the layer.

## Relationships

### Conforms To

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

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

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

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

[`CAMediaTiming`](/documentation/QuartzCore/CAMediaTiming)

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

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

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

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

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

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

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

### Inherits From

[`CAOpenGLLayer`](/documentation/QuartzCore/CAOpenGLLayer)

---

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)