Contents

init(_:)

Creates a custom render layer with the specified compile-time constant name.

Declaration

init(_ rawValue: StaticString)

Parameters

  • rawValue:

    A unique compile-time constant name for this layer.

Discussion

This initializer accepts only compile-time string constants. A precondition checks the validity of the layer name. Use this for defining layer constants in extensions of RenderLayer.

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

This can look like layer constants as extensions:

extension RenderLayer {
    static let background = RenderLayer("com.myapp.background")
}