Instance Method


Returns the value of a lighting attribute.


func attribute(forKey key: String) -> Any?



A constant specifying a lighting attribute. See Lighting Attribute Keys for available keys and their possible values.

Return Value

The value of the lighting attribute, or nil if no such attribute exists.


A light’s type property determines its set of available attributes.

You can also get the values of lighting attributes using Key-value coding. The key path for each lighting attribute is listed in Lighting Attribute Keys.

See Also

Managing Light Attributes

var name: String?

A name associated with the light.

func setAttribute(Any?, forKey: String)

Sets the value for a lighting attribute.

Lighting Attribute Keys

Keys for specifying the behavior of a light using the attribute(forKey:) and setAttribute(_:forKey:) methods.