---
title: topAnchor
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nslayoutguide/topanchor
---

# topAnchor

A layout anchor representing the top edge of the layout guide’s frame.

## Declaration

```swift
var topAnchor: NSLayoutYAxisAnchor { get }
```

## Discussion

Discussion Use this anchor to create constraints with the layout guide’s top edge. You can combine this anchor only with other NSLayoutYAxisAnchor anchors. For more information, see NSLayoutAnchor.

## See Also

### Creating Constraints Using Layout Anchors

- [bottomAnchor](appkit/nslayoutguide/bottomanchor.md)
- [centerXAnchor](appkit/nslayoutguide/centerxanchor.md)
- [centerYAnchor](appkit/nslayoutguide/centeryanchor.md)
- [heightAnchor](appkit/nslayoutguide/heightanchor.md)
- [leadingAnchor](appkit/nslayoutguide/leadinganchor.md)
- [leftAnchor](appkit/nslayoutguide/leftanchor.md)
- [rightAnchor](appkit/nslayoutguide/rightanchor.md)
- [trailingAnchor](appkit/nslayoutguide/trailinganchor.md)
- [widthAnchor](appkit/nslayoutguide/widthanchor.md)
