<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSPopUpButtonCell/preferredEdge",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPopUpButtonCell(py)preferredEdge"
  },
  "title" : "preferredEdge"
}
-->

# preferredEdge

The edge of the cell from which the menu should pop out when screen conditions are restrictive.

```
var preferredEdge: NSRectEdge { get set }
```

## Discussion

At display time, if attaching the menu to the preferred edge would cause part of the menu to be obscured, the pop-up button may use a different edge. If no preferred edge is set, the pop-up button uses the bottom edge by default, which is <doc://com.apple.documentation/documentation/Foundation/NSRectEdge/NSMaxYEdge> for flipped views or <doc://com.apple.documentation/documentation/Foundation/NSRectEdge/NSMinYEdge> for unflipped views. Additional values for this property include <doc://com.apple.documentation/documentation/Foundation/NSRectEdge/NSMinXEdge> and <doc://com.apple.documentation/documentation/Foundation/NSRectEdge/NSMaxXEdge>.

The exact location of the arrow is determined by examining the value of this property and [`arrowPosition`](/documentation/AppKit/NSPopUpButtonCell/arrowPosition).

- If the arrow position is [`NSPopUpButton.ArrowPosition.arrowAtCenter`](/documentation/AppKit/NSPopUpButton/ArrowPosition/arrowAtCenter), the arrow stays in the center of the button and the value of this property determines which edge the arrow points to: `NSMinXEdge` points to the left, `NSMaxYEdge` points to the top, `NSMaxXEdge` points to the right, and `NSMinYEdge` points to the bottom.
- If the arrow position is [`NSPopUpButton.ArrowPosition.arrowAtBottom`](/documentation/AppKit/NSPopUpButton/ArrowPosition/arrowAtBottom), the value of this property determines which edge at which the arrow is placed: `NSMinXEdge` places the arrow at the center of the left side, pointing to the left, `NSMinYEdge` places the arrow at bottom right corner, pointing up, `NSMaxXEdge` places the arrow at the center of the right side, pointing to the right, and `NSMaxYEdge` places the arrow at the bottom right corner, pointing down.

---

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)