<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSView/frame",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSView(py)frame"
  },
  "title" : "frame"
}
-->

# frame

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

```
var frame: NSRect { get set }
```

## Discussion

Changing the value of this property repositions and resizes the view within the coordinate system of its superview. Changing the frame does not mark the view as needing to be displayed. Set the [`needsDisplay`](/documentation/AppKit/NSView/needsDisplay) property to <doc://com.apple.documentation/documentation/Swift/true> when you want the view to be redisplayed.

If your view does not use a custom bounds rectangle, this method also sets the view’s bounds to match the size of the new frame. You can specify a custom bounds rectangle by changing the [`bounds`](/documentation/AppKit/NSView/bounds) property or by calling the [`setBoundsOrigin(_:)`](/documentation/AppKit/NSView/setBoundsOrigin(_:)) or [`setBoundsSize(_:)`](/documentation/AppKit/NSView/setBoundsSize(_:)) method explicitly. Once set, the view creates an internal transform to convert from frame coordinates to bounds coordinates. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed.

The frame rectangle may be rotated relative to its superview’s coordinate system. For more information, see the [`frameRotation`](/documentation/AppKit/NSView/frameRotation) property.

Changing the value of this property results in the posting of an [`frameDidChangeNotification`](/documentation/AppKit/NSView/frameDidChangeNotification) to the default notification center if the view is configured to do so.

## See Also

[`bounds`](/documentation/AppKit/NSView/bounds)

The view’s bounds rectangle, which expresses its location and size in its own 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)