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

Use this initializer to define reusable layer constants in an extension. Use descriptive names with namespace prefixes such as "com.myapp.hero" or "com.myapp.background" to avoid conflicts with other layers.

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

To create a layer from a runtime string, use init(rawValue:) instead.