show(relativeTo:of:preferredEdge:)
Shows the popover anchored to the specified view.
Declaration
func show(relativeTo positioningRect: NSRect, of positioningView: NSView, preferredEdge: NSRectEdge)Parameters
- positioningRect:
The rectangle within
positioningViewrelative to which the popover should be positioned. Normally set to the bounds ofpositioningView. May be an empty rectangle, which will default to the bounds ofpositioningView. - positioningView:
The view relative to which the popover should be positioned. Causes the method to raise Invalidargumentexception if
nil. - preferredEdge:
The edge of
positioningViewthe popover should prefer to be anchored to.
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.