---
title: enclosingMenuItem
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsview/enclosingmenuitem
---

# enclosingMenuItem

The menu item containing the view or any of its superviews in the view hierarchy.

## Declaration

```swift
var enclosingMenuItem: NSMenuItem? { get }
```

## Discussion

Discussion The value of this property is nil if the view is not in a menu item.

## See Also

### Getting the Related Objects

- [superview](appkit/nsview/superview.md)
- [subviews](appkit/nsview/subviews.md)
- [window](appkit/nsview/window.md)
- [opaqueAncestor](appkit/nsview/opaqueancestor.md)
- [isDescendant(of:)](appkit/nsview/isdescendant(of:).md)
- [ancestorShared(with:)](appkit/nsview/ancestorshared(with:).md)
- [enclosingScrollView](appkit/nsview/enclosingscrollview.md)
