---
title: "resize(withOldSuperlayerSize:)"
framework: quartzcore
role: symbol
role_heading: Instance Method
path: "quartzcore/calayer/resize(witholdsuperlayersize:)"
---

# resize(withOldSuperlayerSize:)

Informs the receiver that the size of its superlayer changed.

## Declaration

```swift
func resize(withOldSuperlayerSize size: CGSize)
```

## Parameters

- `size`: The previous size of the superlayer.

## Discussion

Discussion When the autoresizingMask property is used for resizing and the bounds of a layer change, that layer calls this method on each of its sublayers. Sublayers use this method to adjust their own frame rectangles to reflect the new superlayer bounds, which can be retrieved directly from the superlayer. The old size of the superlayer is passed to this method so that the sublayer has that information for any calculations it must make.

## See Also

### Managing layer resizing and layout

- [layoutManager](quartzcore/calayer/layoutmanager.md)
- [setNeedsLayout()](quartzcore/calayer/setneedslayout().md)
- [layoutSublayers()](quartzcore/calayer/layoutsublayers().md)
- [layoutIfNeeded()](quartzcore/calayer/layoutifneeded().md)
- [needsLayout()](quartzcore/calayer/needslayout().md)
- [autoresizingMask](quartzcore/calayer/autoresizingmask.md)
- [resizeSublayers(withOldSize:)](quartzcore/calayer/resizesublayers(witholdsize:).md)
- [preferredFrameSize()](quartzcore/calayer/preferredframesize().md)
