Skip to content

CALayer: superlayer property ​

The superlayer property is the layer's superlayer.

Value ​

A CALayer, or null.

Examples ​

js
const parent = new CALayer();
const child = new CALayer();
parent.addSublayer(child);
console.log(child.superlayer === parent);
child.removeFromSuperlayer();
console.log(child.superlayer);

Result: It prints true, then null.

Corresponding iOS API ​

CALayer.superlayer.

See also ​