Contents

replaceSublayer(_:with:)

Replaces the specified sublayer with a different layer object.

Declaration

func replaceSublayer(_ oldLayer: CALayer, with newLayer: CALayer)

Parameters

  • oldLayer:

    The layer to be replaced.

  • newLayer:

    The layer with which to replace oldLayer.

Discussion

If oldLayer is not in the receiver’s sublayers array, the behavior of this method is undefined.

See Also

Managing the layer hierarchy