---
title: NSLayoutXAxisAnchor
framework: appkit
role: symbol
role_heading: Class
path: appkit/nslayoutxaxisanchor
---

# NSLayoutXAxisAnchor

A factory class for creating horizontal layout constraint objects using a fluent API.

## Declaration

```swift
class NSLayoutXAxisAnchor
```

## Overview

Overview NSLayoutXAxisAnchor adds type information to the methods inherited from NSLayoutAnchor. Specifically, the generic methods declared by NSLayoutAnchor must now take a matching NSLayoutXAxisAnchor object. For more information on using layout anchors, see NSLayoutAnchor.

## Topics

### Building system spacing constraints

- [constraint(equalToSystemSpacingAfter:multiplier:)](appkit/nslayoutxaxisanchor/constraint(equaltosystemspacingafter:multiplier:).md)
- [constraint(greaterThanOrEqualToSystemSpacingAfter:multiplier:)](appkit/nslayoutxaxisanchor/constraint(greaterthanorequaltosystemspacingafter:multiplier:).md)
- [constraint(lessThanOrEqualToSystemSpacingAfter:multiplier:)](appkit/nslayoutxaxisanchor/constraint(lessthanorequaltosystemspacingafter:multiplier:).md)
- [Creating self-sizing table view cells](uikit/creating-self-sizing-table-view-cells.md)

### Creating a layout dimension

- [anchorWithOffset(to:)](appkit/nslayoutxaxisanchor/anchorwithoffset(to:).md)

## Relationships

### Inherits From

- [NSLayoutAnchor](appkit/nslayoutanchor.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Related Documentation

- [NSLayoutConstraint](appkit/nslayoutconstraint.md)
- [NSLayoutYAxisAnchor](appkit/nslayoutyaxisanchor.md)

### Anchors

- [NSLayoutAnchor](appkit/nslayoutanchor.md)
- [NSLayoutYAxisAnchor](appkit/nslayoutyaxisanchor.md)
