Contents

init(rawValue:)

Creates a custom render layer with the specified runtime name.

Declaration

init?(rawValue: String)

Parameters

  • rawValue:

    A unique name for this layer.

Return Value

A new RenderLayer instance, or nil if the name is invalid.

Discussion

This failable initializer allows creating layers from runtime string values, such as user input or data loaded from files. Returns nil if the layer name is invalid (empty).

Use descriptive names with namespace prefixes to avoid conflicts, such as "com.myapp.hero-lighting" or "com.myapp.background".