<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/NSLayoutConstraint/FormatOptions",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:@E@NSLayoutFormatOptions"
  },
  "title" : "NSLayoutConstraint.FormatOptions"
}
-->

# NSLayoutConstraint.FormatOptions

A bit mask that specifies both a part of an interface element to align and a direction for the alignment between two interface elements.

```
struct FormatOptions
```

## Topics

### Constants

[`NSLayoutFormatAlignAllLeft`](/documentation/UIKit/NSLayoutConstraint/FormatOptions/alignAllLeft)

Align all specified interface elements using [`NSLayoutConstraint.Attribute.left`](/documentation/UIKit/NSLayoutConstraint/Attribute/left) on each.

[`NSLayoutFormatAlignAllRight`](/documentation/UIKit/NSLayoutConstraint/FormatOptions/alignAllRight)

Align all specified interface elements using [`NSLayoutConstraint.Attribute.right`](/documentation/UIKit/NSLayoutConstraint/Attribute/right) on each.

[`NSLayoutFormatAlignAllTop`](/documentation/UIKit/NSLayoutConstraint/FormatOptions/alignAllTop)

Align all specified interface elements using [`NSLayoutConstraint.Attribute.top`](/documentation/UIKit/NSLayoutConstraint/Attribute/top) on each.

[`NSLayoutFormatAlignAllBottom`](/documentation/UIKit/NSLayoutConstraint/FormatOptions/alignAllBottom)

Align all specified interface elements using [`NSLayoutConstraint.Attribute.bottom`](/documentation/UIKit/NSLayoutConstraint/Attribute/bottom) on each.

[`NSLayoutFormatAlignAllLeading`](/documentation/UIKit/NSLayoutConstraint/FormatOptions/alignAllLeading)

Align all specified interface elements using [`NSLayoutConstraint.Attribute.leading`](/documentation/UIKit/NSLayoutConstraint/Attribute/leading) on each.

[`NSLayoutFormatAlignAllTrailing`](/documentation/UIKit/NSLayoutConstraint/FormatOptions/alignAllTrailing)

Align all specified interface elements using [`NSLayoutConstraint.Attribute.trailing`](/documentation/UIKit/NSLayoutConstraint/Attribute/trailing) on each.

[`NSLayoutFormatAlignAllCenterX`](/documentation/UIKit/NSLayoutConstraint/FormatOptions/alignAllCenterX)

Align all specified interface elements using [`NSLayoutConstraint.Attribute.centerX`](/documentation/UIKit/NSLayoutConstraint/Attribute/centerX) on each.

[`NSLayoutFormatAlignAllCenterY`](/documentation/UIKit/NSLayoutConstraint/FormatOptions/alignAllCenterY)

Align all specified interface elements using [`NSLayoutConstraint.Attribute.centerY`](/documentation/UIKit/NSLayoutConstraint/Attribute/centerY) on each.

[`NSLayoutFormatAlignAllBaseline`](/documentation/UIKit/NSLayoutFormatOptions/NSLayoutFormatAlignAllBaseline)

Align all specified interface elements using [`NSLayoutAttributeBaseline`](/documentation/UIKit/NSLayoutAttribute/NSLayoutAttributeBaseline) on each.

[`NSLayoutFormatAlignAllLastBaseline`](/documentation/UIKit/NSLayoutConstraint/FormatOptions/alignAllLastBaseline)

Align all specified interface elements using the last baseline of each one.

[`NSLayoutFormatAlignAllFirstBaseline`](/documentation/UIKit/NSLayoutConstraint/FormatOptions/alignAllFirstBaseline)

Align all specified interface elements using the first baseline of each one.

[`NSLayoutFormatAlignmentMask`](/documentation/UIKit/NSLayoutConstraint/FormatOptions/alignmentMask)

Bit mask that can be combined with a [`NSLayoutConstraint.FormatOptions`](/documentation/UIKit/NSLayoutConstraint/FormatOptions) variable to yield only the alignment portion of the format options.

[`NSLayoutFormatDirectionLeadingToTrailing`](/documentation/UIKit/NSLayoutConstraint/FormatOptions/directionLeadingToTrailing)

Arrange objects in order based on the normal text flow for the current user interface language. In left-to-right languages (like English), this arrangement results in the first object being placed farthest to the left, the next one to its right, and so on. In right-to-left languages (like Arabic or Hebrew), the ordering is reversed.

[`NSLayoutFormatDirectionLeftToRight`](/documentation/UIKit/NSLayoutConstraint/FormatOptions/directionLeftToRight)

Arrange objects in order from left to right.

[`NSLayoutFormatDirectionRightToLeft`](/documentation/UIKit/NSLayoutConstraint/FormatOptions/directionRightToLeft)

Arrange objects in order from right to left.

[`NSLayoutFormatDirectionMask`](/documentation/UIKit/NSLayoutConstraint/FormatOptions/directionMask)

A bit mask that can be combined with an [`NSLayoutConstraint.FormatOptions`](/documentation/UIKit/NSLayoutConstraint/FormatOptions) variable to yield only the direction portion of the format options.

[`NSLayoutFormatSpacingEdgeToEdge`](/documentation/UIKit/NSLayoutFormatOptions/NSLayoutFormatSpacingEdgeToEdge)

Align the elements using their edges instead of using their baselines.

[`NSLayoutFormatSpacingBaselineToBaseline`](/documentation/UIKit/NSLayoutConstraint/FormatOptions/spacingBaselineToBaseline)

Align elements vertically according to their baseline positions.

[`NSLayoutFormatSpacingMask`](/documentation/UIKit/NSLayoutConstraint/FormatOptions/spacingMask)

A bit mask that can be combined with an [`NSLayoutConstraint.FormatOptions`](/documentation/UIKit/NSLayoutConstraint/FormatOptions) variable to yield only the spacing baseline spacing portion of the format options.

### Initializers

[`init(rawValue:)`](/documentation/UIKit/NSLayoutConstraint/FormatOptions/init(rawValue:))

Creates a formatting-options structure with the specified raw value.

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

---

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)