Instance Property

device

The Metal device responsible for the layer’s drawable resources.

Declaration

var device: MTLDevice? { get set }

Discussion

This property determines which device object Metal uses to create its MTLTexture objects. When you retrieve a drawable object and its associated texture, you must render to the texture using the same device object.

The default value is nil—you must set the device for a layer before rendering.

See Also

Configuring the Metal Device

var preferredDevice: MTLDevice?

The device object that the system recommends using for this layer.