<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGContext/beginTransparencyLayer(in:auxiliaryInfo:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Graphics",
      "CoreGraphics"
    ],
    "preciseIdentifier" : "c:@F@CGContextBeginTransparencyLayerWithRect"
  },
  "title" : "beginTransparencyLayer(in:auxiliaryInfo:)"
}
-->

# beginTransparencyLayer(in:auxiliaryInfo:)

Begins a transparency layer whose contents are bounded by the specified rectangle.

```
func beginTransparencyLayer(in rect: CGRect, auxiliaryInfo auxInfo: CFDictionary?)
```

## Parameters

`rect`

The rectangle, specified in user space, that bounds the transparency layer.

`auxInfo`

A dictionary that specifies any additional information, or `nil`.

## Discussion

This function is identical to [`beginTransparencyLayer(auxiliaryInfo:)`](/documentation/CoreGraphics/CGContext/beginTransparencyLayer(auxiliaryInfo:)) except that the content of the transparency layer is within the bounds of the provided rectangle.

---

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)