<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "QuartzCore",
  "identifier" : "/documentation/QuartzCore/CALayer/preferredFrameSize()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Animation"
    ],
    "preciseIdentifier" : "c:objc(cs)CALayer(im)preferredFrameSize"
  },
  "title" : "preferredFrameSize()"
}
-->

# preferredFrameSize()

Returns the preferred size of the layer in the coordinate space of its superlayer.

```
func preferredFrameSize() -> CGSize
```

## Return Value

The layer’s preferred frame size.

## Discussion

In macOS, the default implementation of this method calls the `preferredSize(of:)` method in Swift or the `preferredSizeOfLayer:` method in Objective-C of its layout manager—that is, the object in its [`layoutManager`](/documentation/QuartzCore/CALayer/layoutManager) property. If that object does not exist or does not implement that method, this method returns the size of the layer’s current [`bounds`](/documentation/QuartzCore/CALayer/bounds) rectangle mapped into the coordinate space of its [`superlayer`](/documentation/QuartzCore/CALayer/superlayer).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)