---
title: presentsWithTransaction
framework: quartzcore
role: symbol
role_heading: Instance Property
path: quartzcore/cametallayer/presentswithtransaction
---

# presentsWithTransaction

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

## Declaration

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

## Mentioned in

Optimizing iPhone and iPad apps to support ProMotion displays

## Discussion

Discussion By default, this value is false; 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 content over the top of your CAMetalLayer. Setting this value to true makes the layer draw its contents synchronously, using whichever Core Animation transaction is current at the time you call the drawable’s 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 waitUntilScheduled() method to synchronously wait until the command queue schedules the command buffer to execute on the GPU. Finally, call the drawable’s present() method. warning: If you’re synchronizing presentation with a Core Animation transaction, don’t use the present(_:) method on the command buffer to schedule the drawable for presentation. This convenience method (and any variant of it on MTLCommandBuffer) doesn’t wait for a transaction to be available.

## See Also

### Configuring Presentation Behavior

- [displaySyncEnabled](quartzcore/cametallayer/displaysyncenabled.md)
