<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UINavigationItem/searchBarPlacementBarButtonItem",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UINavigationItem(py)searchBarPlacementBarButtonItem"
  },
  "title" : "searchBarPlacementBarButtonItem"
}
-->

# searchBarPlacementBarButtonItem

An item you use to control the placement of the search bar in a toolbar on iPhone.

```
var searchBarPlacementBarButtonItem: UIBarButtonItem { get }
```

## Overview

When [`searchBarPlacement`](/documentation/UIKit/UINavigationItem/searchBarPlacement-swift.property) is `.integrated` or `.integratedButton` and a search controller is present, use this bar button item in the view controller’s [`toolbarItems`](/documentation/UIKit/UIViewController/toolbarItems) to control the placement of the search bar among them when the search bar is appearing in the [`UIToolbar`](/documentation/UIKit/UIToolbar) on iPhone. Without this bar button item, the positioning for the search bar defaults to trailingmost for the [`UIToolbar`](/documentation/UIKit/UIToolbar) case.

The system ignores this bar button item during toolbar layout if [`searchController`](/documentation/UIKit/UINavigationItem/searchController) is `nil`. [`UIBarButtonItemGroup`](/documentation/UIKit/UIBarButtonItemGroup) throws an <doc://com.apple.documentation/documentation/Foundation/NSExceptionName/invalidArgumentException> when you include this bar button item in its initialization. [`UINavigationItem`](/documentation/UIKit/UINavigationItem) throws an <doc://com.apple.documentation/documentation/Foundation/NSExceptionName/invalidArgumentException> when you include this bar button item in [`leftBarButtonItems`](/documentation/UIKit/UINavigationItem/leftBarButtonItems) or [`rightBarButtonItems`](/documentation/UIKit/UINavigationItem/rightBarButtonItems).

---

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)