<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "QuartzCore",
  "identifier" : "/documentation/QuartzCore/CAMetalDisplayLink",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Animation"
    ],
    "preciseIdentifier" : "c:objc(cs)CAMetalDisplayLink"
  },
  "title" : "CAMetalDisplayLink"
}
-->

# CAMetalDisplayLink

A class your Metal app uses to register for callbacks to synchronize its animations for a display.

```
class CAMetalDisplayLink
```

## Overview

[`CAMetalDisplayLink`](/documentation/QuartzCore/CAMetalDisplayLink) instances are a specialized way to interact with variable-rate displays when you need more control over the timing window to render your app’s frames. Controlling the timing window and rendering delay for frames can help you achieve smoother frame rates and avoid visual artifacts.

> Tip:
> When working with less visually intensive apps or apps which don’t use Metal, use ``doc://com.apple.quartzcore/documentation/QuartzCore/CADisplayLink`` to handle variable refresh rates.

Your app initializes a new Metal display link by providing a target [`CAMetalLayer`](/documentation/QuartzCore/CAMetalLayer). Set this instance’s [`delegate`](/documentation/QuartzCore/CAMetalDisplayLink/delegate) property to an implementation that encodes the rendering work for Metal to perform. With a set delegate, synchronize the display with a run loop to perform rendering on by calling the [`add(to:forMode:)`](/documentation/QuartzCore/CAMetalDisplayLink/add(to:forMode:)) method.

Once you associate the display link with a run loop, the system calls the delegate’s [`metalDisplayLink(_:needsUpdate:)`](/documentation/QuartzCore/CAMetalDisplayLinkDelegate/metalDisplayLink(_:needsUpdate:)) method to request new frames. This method receives update requests based on the [`preferredFrameRateRange`](/documentation/QuartzCore/CAMetalDisplayLink/preferredFrameRateRange) and [`preferredFrameLatency`](/documentation/QuartzCore/CAMetalDisplayLink/preferredFrameLatency) of the display link. The system makes a best effort to make callbacks at appropriate times. Your app should complete any commits to the Metal device’s <doc://com.apple.documentation/documentation/Metal/MTLCommandQueue> for rendering the display layer before calling <doc://com.apple.documentation/documentation/Metal/MTLDrawable/present()> on a drawable element.

Your app can disable notifications by setting [`isPaused`](/documentation/QuartzCore/CAMetalDisplayLink/isPaused) to `true`. When your app finishes with a display link, call [`invalidate()`](/documentation/QuartzCore/CAMetalDisplayLink/invalidate())to remove it from all run loops and the target.

## Topics

### Creating a Display Link

[`init(metalLayer:)`](/documentation/QuartzCore/CAMetalDisplayLink/init(metalLayer:))

Creates a display link for Metal from a Core Animation layer.

### Configuring a Display Link

[`preferredFrameRateRange`](/documentation/QuartzCore/CAMetalDisplayLink/preferredFrameRateRange)

A range of frequencies your app allows for frame updates, affecting how often the system invokes your delegate’s callback.

[`preferredFrameLatency`](/documentation/QuartzCore/CAMetalDisplayLink/preferredFrameLatency)

The amount of time, in frames, your app requests to render a frame.

[`delegate`](/documentation/QuartzCore/CAMetalDisplayLink/delegate)

An instance of a type your app implements that responds to the system’s callbacks.

### Registering for Callbacks

[`add(to:forMode:)`](/documentation/QuartzCore/CAMetalDisplayLink/add(to:forMode:))

Registers the display link with a run loop.

### Pausing Callbacks

[`isPaused`](/documentation/QuartzCore/CAMetalDisplayLink/isPaused)

A Boolean value that indicates whether the system suspends the display link’s notifications to the target.

### Deregistering for callbacks

[`remove(from:forMode:)`](/documentation/QuartzCore/CAMetalDisplayLink/remove(from:forMode:))

Removes a mode’s display link from a run loop.

[`invalidate()`](/documentation/QuartzCore/CAMetalDisplayLink/invalidate())

Removes the display link from all run loops for all modes.

### Classes

[`CAMetalDisplayLink.Update`](/documentation/QuartzCore/CAMetalDisplayLink/Update)

Stores information about a single update from a Metal display link instance.



---

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)