<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "QuartzCore",
  "identifier" : "/documentation/QuartzCore/CAMetalLayer/presentsWithTransaction",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Core Animation"
    ],
    "preciseIdentifier" : "c:objc(cs)CAMetalLayer(py)presentsWithTransaction"
  },
  "title" : "presentsWithTransaction"
}
-->

# presentsWithTransaction

A Boolean value that determines whether the layer presents its content using a Core Animation transaction.

```
var presentsWithTransaction: Bool { get set }
```

## Discussion

By default, this value is <doc://com.apple.documentation/documentation/Swift/false>; [`CAMetalLayer`](/documentation/QuartzCore/CAMetalLayer) displays the output of a rendering pass to the display as quickly as possible and asynchronously to any Core Animation transactions. Core Animation doesn’t guarantee that the Metal content arrives in the same frame as other Core Animation content. This behavior could be an issue if, for example, your app draws [UIKit](https://developer.apple.com/library/archive/releasenotes/General/RN-iOSSDK-6_1/index.html#//apple_ref/doc/uid/TP40012869-CH1-SW17) content over the top of your [`CAMetalLayer`](/documentation/QuartzCore/CAMetalLayer).

Setting this value to <doc://com.apple.documentation/documentation/Swift/true> makes the layer draw its contents synchronously, using whichever Core Animation transaction is current at the time you call the drawable’s <doc://com.apple.documentation/documentation/Metal/MTLDrawable/present()> method. To ensure that a transaction is available when you schedule the drawable to be presented, first commit the command buffer containing your Metal rendering commands. Then, call its <doc://com.apple.documentation/documentation/Metal/MTLCommandBuffer/waitUntilScheduled()> method to synchronously wait until the command queue schedules the command buffer to execute on the GPU. Finally, call the drawable’s <doc://com.apple.documentation/documentation/Metal/MTLDrawable/present()> method.

> Warning:
> If you’re synchronizing presentation with a Core Animation transaction, don’t use the <doc://com.apple.documentation/documentation/Metal/MTLCommandBuffer/present(_:)> method on the command buffer to schedule the drawable for presentation. This convenience method (and any variant of it on <doc://com.apple.documentation/documentation/Metal/MTLCommandBuffer>) doesn’t wait for a transaction to be available.

---

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)