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

# expansionFrame(withFrame:)

The frame in which a tool tip can be displayed, if needed.

```
func expansionFrame(withFrame contentFrame: NSRect) -> NSRect
```

## Parameters

`contentFrame`

The frame of the control.

## Return Value

The frame in which the tool tip should be displayed, or <doc://com.apple.documentation/documentation/Foundation/NSZeroRect> by default.

## Discussion

This method lets the control  return an expansion tool tip frame if `contentFrame` is too small for the entire contents in the view. When the pointer hovers over the text in certain controls, the full contents will be shown in a special floating tool tip view. If the frame is big enough to display the contents, return an empty rect from this method and no expansion tool tip view will be shown. Note that some subclasses, such as [`NSTextField`](/documentation/AppKit/NSTextField), return the proper frame when required.

---

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)