Tells the delegate a layer's bounds have changed.
- iOS 10.0+
- macOS 10.12+
- Mac Catalyst 13.0+
- tvOS 10.0+
- Core Animation
The layer that requires layout of its sublayers.
layout method is called when a layer's bounds have changed and its sublayers may need rearranging, for example by changing its frame's size. You can implement this method if you need precise control over the layout of your layer's sublayers.
Listing 1 shows how you can create a class named
Layer that implements CALayerDelegate and sets it as a layer's (named
sublayer) delegate. When the layer's size changes, the delegate's
layout iterates over all of the sublayers of
sublayer and resizes them to fit within it.