<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/AlignmentOptions",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@E@NSAlignmentOptions"
  },
  "title" : "AlignmentOptions"
}
-->

# AlignmentOptions

Values representing alignment operations.

```
struct AlignmentOptions
```

## Overview

These constants are used by the [`NSIntegralRectWithOptions(_:_:)`](/documentation/Foundation/NSIntegralRectWithOptions(_:_:)) function and other related methods, such as <doc://com.apple.documentation/documentation/AppKit/NSView/backingAlignedRect(_:options:)>.

## Topics

### Constants

[`NSAlignMinXInward`](/documentation/Foundation/AlignmentOptions/alignMinXInward)

Specifies that alignment of the minimum X coordinate should be to the nearest inward integral value.

[`NSAlignMinYInward`](/documentation/Foundation/AlignmentOptions/alignMinYInward)

Specifies that alignment of the minimum Y coordinate should be to the nearest inward integral value.

[`NSAlignMaxXInward`](/documentation/Foundation/AlignmentOptions/alignMaxXInward)

Specifies that alignment of the maximum X coordinate should be to the nearest inward integral value.

[`NSAlignMaxYInward`](/documentation/Foundation/AlignmentOptions/alignMaxYInward)

Specifies that alignment of the maximum X coordinate should be to the nearest inward integral value.

[`NSAlignWidthInward`](/documentation/Foundation/AlignmentOptions/alignWidthInward)

Specifies that alignment of the width should be to the nearest inward integral value.

[`NSAlignHeightInward`](/documentation/Foundation/AlignmentOptions/alignHeightInward)

Specifies that alignment of the height should be to the nearest inward integral value.

[`NSAlignMinXOutward`](/documentation/Foundation/AlignmentOptions/alignMinXOutward)

Specifies that alignment of the minimum X coordinate should be to the nearest outward integral value.

[`NSAlignMinYOutward`](/documentation/Foundation/AlignmentOptions/alignMinYOutward)

Specifies that alignment of the minimum Y coordinate should be to the nearest outward integral value.

[`NSAlignMaxXOutward`](/documentation/Foundation/AlignmentOptions/alignMaxXOutward)

Specifies that alignment of the maximum X coordinate should be to the nearest outward integral value.

[`NSAlignMaxYOutward`](/documentation/Foundation/AlignmentOptions/alignMaxYOutward)

Specifies that alignment of the maximum Y coordinate should be to the nearest outward integral value.

[`NSAlignWidthOutward`](/documentation/Foundation/AlignmentOptions/alignWidthOutward)

Specifies that alignment of the width should be to the nearest outward integral value.

[`NSAlignHeightOutward`](/documentation/Foundation/AlignmentOptions/alignHeightOutward)

Specifies that alignment of the height should be to the nearest outward integral value.

[`NSAlignMinXNearest`](/documentation/Foundation/AlignmentOptions/alignMinXNearest)

Specifies that alignment of the minimum X coordinate should be to the nearest integral value.

[`NSAlignMinYNearest`](/documentation/Foundation/AlignmentOptions/alignMinYNearest)

Specifies that alignment of the minimum Y coordinate should be to the nearest integral value.

[`NSAlignMaxXNearest`](/documentation/Foundation/AlignmentOptions/alignMaxXNearest)

Specifies that alignment of the maximum X coordinate should be to the nearest integral value.

[`NSAlignMaxYNearest`](/documentation/Foundation/AlignmentOptions/alignMaxYNearest)

Specifies that alignment of the maximum Y coordinate should be to the nearest integral value.

[`NSAlignWidthNearest`](/documentation/Foundation/AlignmentOptions/alignWidthNearest)

Specifies that alignment of the width should be to the nearest integral value.

[`NSAlignHeightNearest`](/documentation/Foundation/AlignmentOptions/alignHeightNearest)

Specifies that alignment of the height should be to the nearest integral value.

[`NSAlignRectFlipped`](/documentation/Foundation/AlignmentOptions/alignRectFlipped)

This option should be included  if the rectangle is in a flipped coordinate system. This allows 0.5 to be treated in a visually consistent way.

[`NSAlignAllEdgesInward`](/documentation/Foundation/AlignmentOptions/alignAllEdgesInward)

Aligns all edges inward. This is the same as `NSAlignMinXInward|NSAlignMaxXInward|NSAlignMinYInward|NSAlignMaxYInward`.

[`NSAlignAllEdgesOutward`](/documentation/Foundation/AlignmentOptions/alignAllEdgesOutward)

Aligns all edges outwards. This is the same as `NSAlignMinXOutward|NSAlignMaxXOutward|NSAlignMinYOutward|NSAlignMaxYOutward`.

[`NSAlignAllEdgesNearest`](/documentation/Foundation/AlignmentOptions/alignAllEdgesNearest)

Aligns all edges to the nearest value. This is the same as `NSAlignMinXNearest|NSAlignMaxXNearest|NSAlignMinYNearest|NSAlignMaxYNearest`.

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

---

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)