<!--
{
  "availability" : [
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSControl/sizeThatFits(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSControl(im)sizeThatFits:"
  },
  "title" : "sizeThatFits(_:)"
}
-->

# sizeThatFits(_:)

Asks the control to calculate and return the size that best fits the specified size.

```
func sizeThatFits(_ size: NSSize) -> NSSize
```

## Parameters

`size`

The size for which the control should calculate its best-fitting size.

## Return Value

A new size that fits the receiver’s subviews.

## Discussion

By default, this method returns the [`intrinsicContentSize`](/documentation/AppKit/NSView/intrinsicContentSize) of the receiver.

---

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)