---
title: "show(relativeTo:of:preferredEdge:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nspopover/show(relativeto:of:preferrededge:)"
---

# show(relativeTo:of:preferredEdge:)

Shows the popover anchored to the specified view.

## Declaration

```swift
func show(relativeTo positioningRect: NSRect, of positioningView: NSView, preferredEdge: NSRectEdge)
```

## Parameters

- `positioningRect`: The rectangle within positioningView relative to which the popover should be positioned. Normally set to the bounds of positioningView. May be an empty rectangle, which will default to the bounds of positioningView.
- `positioningView`: The view relative to which the popover should be positioned. Causes the method to raise doc://com.apple.documentation/documentation/Foundation/NSExceptionName/invalidArgumentException if nil.
- `preferredEdge`: The edge of positioningView the popover should prefer to be anchored to.

## Discussion

Discussion This method raises internalInconsistencyException if contentViewController or the view controller’s view is nil. If the popover is already being shown, this method updates the anchored view, rectangle, and preferred edge. If the positioning view is not visible, this method does nothing.

## See Also

### Managing a Popover’s Position and Size

- [behavior](appkit/nspopover/behavior-swift.property.md)
- [positioningRect](appkit/nspopover/positioningrect.md)
