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

# bounds

The view’s bounds rectangle, which expresses its location and size in its own coordinate system.

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

## Discussion

By default, this property contains a rectangle whose origin is (0, 0) and whose size matches the size of the view’s frame rectangle (measured in points). In macOS 10.5 and later, if the view is being rendered into an OpenGL graphics context (using an [`NSOpenGLContext`](/documentation/AppKit/NSOpenGLContext) object), the default bounds origin is still (0, 0) but the default bounds size is measured in pixels instead of points. Thus, for user space scale factors other than 1.0, the default size of the bounds rectangle may be bigger or smaller than the default size of the frame rectangle when drawing with OpenGL.

> Important:
> Developers of OpenGL applications should not rely on the rectangle in this property to convert coordinates to pixels automatically in future releases. Instead, you should convert coordinates to device space explicitly using the ``doc://com.apple.appkit/documentation/AppKit/NSView/convertPointToBase:``, ``doc://com.apple.appkit/documentation/AppKit/NSView/convertSizeToBase:``, or ``doc://com.apple.appkit/documentation/AppKit/NSView/convertRectToBase:`` methods or their earlier counterparts ``doc://com.apple.appkit/documentation/AppKit/NSView/convert(_:to:)-6u9ir``, ``doc://com.apple.appkit/documentation/AppKit/NSView/convert(_:to:)-5nptx``, or ``doc://com.apple.appkit/documentation/AppKit/NSView/convert(_:to:)-3cqqt``.

If you explicitly change the origin or size of the bounds rectangle, this property saves the rectangle you set. If you add a rotation factor to the view, however, that factor is also reflected in the returned bounds rectangle. You can determine if a rotation factor is in effect by getting the value of the [`boundsRotation`](/documentation/AppKit/NSView/boundsRotation) property.

Changing the bounds 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. After changing the bounds rectangle, the view creates an internal transform, a tool for manipulating coordinates, (or appends these changes to an existing internal transform) to convert from frame coordinates to bounds coordinates in your view. 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. For more information, see [View Coordinates](/documentation/AppKit/view-coordinates).

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

## See Also

[`frame`](/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)