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

# NSPopover

A means to display additional content related to existing content on the screen.

```
class NSPopover
```

## Overview

The popover is positioned relative to the existing content and an anchor is used to express the relation between these two units of content. A popover has an appearance that specifies its visual characteristics, as well as a behavior that determines which user interactions will cause the popover to close. A transient popover is closed in response to most user interactions, whereas a semi-transient popover is closed when the user interacts with the window containing the popover’s positioning view. Popovers with application-defined behavior are not usually closed on the developer’s behalf.

The system automatically positions each popover relative to its positioning view and moves the popover whenever its positioning view moves. A positioning rectangle within the positioning view can be specified for additional granularity.

Popovers can be detached to become a separate window when they are dragged by implementing the appropriate delegate method.

## Topics

### Accessing a Popover’s Content View Controller

[`contentViewController`](/documentation/AppKit/NSPopover/contentViewController)

The view controller that manages the content of the popover.

### Managing a Popover’s Position and Size

[`behavior`](/documentation/AppKit/NSPopover/behavior-swift.property)

Specifies the behavior of the popover.

[`show(relativeTo:of:preferredEdge:)`](/documentation/AppKit/NSPopover/show(relativeTo:of:preferredEdge:))

Shows the popover anchored to the specified view.

[`positioningRect`](/documentation/AppKit/NSPopover/positioningRect)

The rectangle within the positioning view relative to which the popover should be positioned.

### Managing a Popover’s Appearance

[`appearance`](/documentation/AppKit/NSPopover/appearance-swift.property)

The appearance of the popover.

[`effectiveAppearance`](/documentation/AppKit/NSPopover/effectiveAppearance)

The appearance that will be used when the popover is displayed onscreen.

[`animates`](/documentation/AppKit/NSPopover/animates)

Specifies if the popover is to be animated.

[`contentSize`](/documentation/AppKit/NSPopover/contentSize)

The content size of the popover.

[`isShown`](/documentation/AppKit/NSPopover/isShown)

The display state of the popover.

[`isDetached`](/documentation/AppKit/NSPopover/isDetached)

A Boolean value that indicates whether the window created by a popover’s detachment is automatically created.

### Closing a Popover

[`performClose(_:)`](/documentation/AppKit/NSPopover/performClose(_:))

Attempts to close the popover.

[`close()`](/documentation/AppKit/NSPopover/close())

Forces the popover to close without consulting its delegate.

### Getting and Setting the Delegate

[`delegate`](/documentation/AppKit/NSPopover/delegate)

The delegate of the popover.

### Constants

[`NSPopover.Behavior`](/documentation/AppKit/NSPopover/Behavior-swift.enum)

The appearance and disappearance behavior of a popover.

[`closeReasonUserInfoKey`](/documentation/AppKit/NSPopover/closeReasonUserInfoKey)

The `userInfo` key containing the reason for the [`willCloseNotification`](/documentation/AppKit/NSPopover/willCloseNotification).

[`NSPopover.CloseReason`](/documentation/AppKit/NSPopover/CloseReason)

Values that specify the reason for the [`willCloseNotification`](/documentation/AppKit/NSPopover/willCloseNotification) notification.

[`NSPopover.Appearance`](/documentation/AppKit/NSPopover/Appearance-swift.enum)

The set of predefined appearances for a popover.

### Notifications

[`willShowNotification`](/documentation/AppKit/NSPopover/willShowNotification)

Sent before the popover is shown.

[`didShowNotification`](/documentation/AppKit/NSPopover/didShowNotification)

Sent after the popover has finished animating onscreen.

[`willCloseNotification`](/documentation/AppKit/NSPopover/willCloseNotification)

Sent before the popover is closed.

[`didCloseNotification`](/documentation/AppKit/NSPopover/didCloseNotification)

Sent after the popover has finished animating offscreen.

### Initializers

[`init()`](/documentation/AppKit/NSPopover/init())

[`init(coder:)`](/documentation/AppKit/NSPopover/init(coder:))

### Instance Properties

[`hasFullSizeContent`](/documentation/AppKit/NSPopover/hasFullSizeContent)

A Boolean value that indicates whether the content view of the popover extends into the arrow region.

### Instance Methods

[`show(relativeTo:)`](/documentation/AppKit/NSPopover/show(relativeTo:))

Shows the popover anchored to the specified toolbar item.



---

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)