---
title: barButtonItem
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uipopoverpresentationcontroller/barbuttonitem
---

# barButtonItem

The bar button item on which to anchor the popover.

## Declaration

```swift
var barButtonItem: UIBarButtonItem? { get set }
```

## Discussion

Discussion 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. The default value of this property is nil.

## See Also

### Specifying the popover’s anchor point

- [sourceItem](uikit/uipopoverpresentationcontroller/sourceitem.md)
- [UIPopoverPresentationControllerSourceItem](uikit/uipopoverpresentationcontrollersourceitem.md)
- [sourceView](uikit/uipopoverpresentationcontroller/sourceview.md)
- [sourceRect](uikit/uipopoverpresentationcontroller/sourcerect.md)
