---
title: topAnchor
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uilayoutguide/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](uikit/uilayoutguide/bottomanchor.md)
- [centerXAnchor](uikit/uilayoutguide/centerxanchor.md)
- [centerYAnchor](uikit/uilayoutguide/centeryanchor.md)
- [heightAnchor](uikit/uilayoutguide/heightanchor.md)
- [leadingAnchor](uikit/uilayoutguide/leadinganchor.md)
- [leftAnchor](uikit/uilayoutguide/leftanchor.md)
- [rightAnchor](uikit/uilayoutguide/rightanchor.md)
- [trailingAnchor](uikit/uilayoutguide/trailinganchor.md)
- [widthAnchor](uikit/uilayoutguide/widthanchor.md)
