<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/RenderLayer/init(rawValue:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation11RenderLayerV8rawValueACSgSS_tcfc"
  },
  "title" : "init(rawValue:)"
}
-->

# init(rawValue:)

Creates a custom render layer with the specified runtime name.

```
init?(rawValue: String)
```

## Parameters

`rawValue`

A unique name for this layer.

## Return Value

A new render layer, or `nil` if `rawValue` is empty.

## Discussion

Use this failable initializer when the layer name comes from a runtime
string, such as user input or data loaded from a file. To define a layer
constant from a string literal, use [`init(_:)`](/documentation/RealityKit/RenderLayer/init(_:)) instead.

Use descriptive names with namespace prefixes such as `"com.myapp.hero"`
or `"com.myapp.background"` to avoid conflicts with other layers.

---

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)