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

# setFrameFromContentFrame(_:)

Places the receiver so its content view lies on the specified frame.

```
func setFrameFromContentFrame(_ contentFrame: NSRect)
```

## Parameters

`contentFrame`

The rectangle specifying the frame of the box’s content view, reckoned in the coordinate system of the box’s superview. The box is marked for redisplay.

## See Also

[`var contentViewMargins: NSSize`](/documentation/AppKit/NSBox/contentViewMargins)

The distances between the border and the content view.

[`var needsDisplay: Bool`](/documentation/AppKit/NSView/needsDisplay)

A Boolean value that determines whether the view needs to be redrawn before being displayed.

[`var frame: NSRect`](/documentation/AppKit/NSView/frame)

The view’s frame rectangle, which defines its position and size in its superview’s coordinate system.



---

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)