---
title: alignmentRectInsets
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uiview/alignmentrectinsets
---

# alignmentRectInsets

The insets from the view’s frame that define its alignment rectangle.

## Declaration

```swift
var alignmentRectInsets: UIEdgeInsets { get }
```

## Discussion

Discussion The default value of this property is an UIEdgeInsets structure with zero values. Custom views that draw ornamentation around their content should use this property to 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:) and frame(forAlignmentRect:) to describe their custom transform between alignment rectangle and frame.

## See Also

### Aligning views in Auto Layout

- [alignmentRect(forFrame:)](uikit/uiview/alignmentrect(forframe:).md)
- [frame(forAlignmentRect:)](uikit/uiview/frame(foralignmentrect:).md)
- [forFirstBaselineLayout](uikit/uiview/forfirstbaselinelayout.md)
- [forLastBaselineLayout](uikit/uiview/forlastbaselinelayout.md)
