---
title: "insertSublayer(_:below:)"
framework: quartzcore
role: symbol
role_heading: Instance Method
path: "quartzcore/calayer/insertsublayer(_:below:)"
---

# insertSublayer(_:below:)

Inserts the specified sublayer below a different sublayer that already belongs to the receiver.

## Declaration

```swift
func insertSublayer(_ layer: CALayer, below sibling: CALayer?)
```

## Parameters

- `layer`: The sublayer to be inserted into the current layer.
- `sibling`: An existing sublayer in the current layer. The layer in aLayer is inserted before this layer in the doc://com.apple.quartzcore/documentation/QuartzCore/CALayer/sublayers array, and thus appears behind it visually.

## Discussion

Discussion If sublayer is not in the receiver’s sublayers array, this method raises an exception.

## See Also

### Managing the layer hierarchy

- [sublayers](quartzcore/calayer/sublayers.md)
- [superlayer](quartzcore/calayer/superlayer.md)
- [addSublayer(_:)](quartzcore/calayer/addsublayer(_:).md)
- [removeFromSuperlayer()](quartzcore/calayer/removefromsuperlayer().md)
- [insertSublayer(_:at:)](quartzcore/calayer/insertsublayer(_:at:).md)
- [insertSublayer(_:above:)](quartzcore/calayer/insertsublayer(_:above:).md)
- [replaceSublayer(_:with:)](quartzcore/calayer/replacesublayer(_:with:).md)
