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 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(_:) instead.

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