---
title: "init(configuration:renderer:)"
framework: compositorservices
role: symbol
role_heading: Initializer
path: "compositorservices/compositorlayer/init(configuration:renderer:)-2uxn7"
---

# init(configuration:renderer:)

Creates a CompositorLayer instance.

## Declaration

```swift
nonisolated init(configuration: any CompositorLayerConfiguration = .default, renderer: @escaping @MainActor (LayerRenderer) -> Void)
```

## Parameters

- `configuration`: The configuration to use when creating the LayerRenderer.
- `renderer`: A closure that receives the layer to use when rendering the content for the immersive space
