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

# calcSize()

Recomputes any internal sizing information for the receiver, if necessary.

```
func calcSize()
```

## Discussion

This method uses the [`calcDrawInfo(_:)`](/documentation/AppKit/NSCell/calcDrawInfo(_:)) method of its cell to perform the calculations. Most controls maintain a flag that informs them if any of their cells have been modified in such a way that the location or size of the cell should be recomputed. If such a modification happens, this method is automatically invoked before the control is displayed. You should never need to invoke it yourself.

## See Also

[`sizeToFit()`](/documentation/AppKit/NSControl/sizeToFit())

Resizes the receiver’s frame so that it’s the minimum size needed to contain its cell.



---

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)