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

# alignmentRectInsets

The insets (in points) from the view’s frame that define its content rectangle.

```
var alignmentRectInsets: NSEdgeInsets { get }
```

## Discussion

The default value is an <doc://com.apple.documentation/documentation/Foundation/NSEdgeInsets> structure with the value `0` for each component. Custom views that draw ornamentation around their content can override this property and return insets that align with the edges of the content, excluding the ornamentation. This allows the constraint-based layout system to align views based on their content, rather than just their frame.

Custom views whose content location can’t be expressed by a simple set of insets should override [`alignmentRect(forFrame:)`](/documentation/AppKit/NSView/alignmentRect(forFrame:)) and [`frame(forAlignmentRect:)`](/documentation/AppKit/NSView/frame(forAlignmentRect:)) to describe their custom transform between alignment rectangle and frame.

---

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)