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

# expansionFrame(withFrame:in:)

Returns the expansion cell frame for the receiver.

```
func expansionFrame(withFrame cellFrame: NSRect, in view: NSView) -> NSRect
```

## Parameters

`cellFrame`

The frame for the receiver.

`view`

The view in which the receiver will be drawn.

## Return Value

The expansion cell frame for the receiver. If the frame is not too small, return an empty rect (<doc://com.apple.documentation/documentation/Foundation/NSZeroRect>), and no expansion tool tip view will be shown.

## Discussion

This method allows the cell to return an expansion cell frame if `cellFrame` is too small for the entire contents in the view. When the mouse is hovered over the cell in certain controls, the full cell contents are shown in a special floating tool tip view. By default, `NSCell` returns `NSZeroRect`, while some subclasses (such as `NSTextFieldCell`) will 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)