Instance Property


The bar button item on which to anchor the popover.


var barButtonItem: UIBarButtonItem? { get set }


Assign a value to this property to anchor the popover to the specified bar button item. When presented, the popover’s arrow points to the specified item. Alternatively, you may specify the anchor location for the popover using the sourceView and sourceRect properties.

Prior to presentation, the presentation controller adds all sibling bar button items of the specified item (but not the item itself) to the popover’s list of passthrough views. UIKit automatically intercepts taps in the specified item and uses them to dismiss the popover. If you want taps in the other bar button items to dismiss the popover, you must add code to the action handlers of those items to do so yourself.

The default value of this property is nil.

See Also

Specifying the Popover’s Anchor Point

var sourceView: UIView?

The view containing the anchor rectangle for the popover.

var sourceRect: CGRect

The rectangle in the specified view in which to anchor the popover.