<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/NSRectAlignment",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:@E@NSRectAlignment"
  },
  "title" : "NSRectAlignment"
}
-->

# NSRectAlignment

Constants that specify alignment to an edge or a set of edges depending on the user interface layout direction.

```
enum NSRectAlignment
```

## Topics

### Alignments

[`NSRectAlignmentNone`](/documentation/UIKit/NSRectAlignment/none)

Has no specified alignment.

[`NSRectAlignmentTop`](/documentation/UIKit/NSRectAlignment/top)

Aligns to the top edge.

[`NSRectAlignmentTopLeading`](/documentation/UIKit/NSRectAlignment/topLeading)

Aligns to the top and leading edges.

[`NSRectAlignmentLeading`](/documentation/UIKit/NSRectAlignment/leading)

Aligns to the leading edge.

[`NSRectAlignmentBottomLeading`](/documentation/UIKit/NSRectAlignment/bottomLeading)

Aligns to the bottom and leading edges.

[`NSRectAlignmentBottom`](/documentation/UIKit/NSRectAlignment/bottom)

Aligns to the bottom edge.

[`NSRectAlignmentBottomTrailing`](/documentation/UIKit/NSRectAlignment/bottomTrailing)

Aligns to the bottom and trailing edges.

[`NSRectAlignmentTrailing`](/documentation/UIKit/NSRectAlignment/trailing)

Aligns to the trailing edge.

[`NSRectAlignmentTopTrailing`](/documentation/UIKit/NSRectAlignment/topTrailing)

Aligns to the top and trailing edges.

## Relationships

### Conforms To

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`Sendable`](/documentation/Swift/Sendable)

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)