---
title: preferredSearchBarPlacement
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uinavigationitem/preferredsearchbarplacement
---

# preferredSearchBarPlacement

The preferred placement of the search bar in the navigation bar.

## Declaration

```swift
var preferredSearchBarPlacement: UINavigationItem.SearchBarPlacement { get set }
```

## Mentioned in

Building a desktop-class iPad app

## Discussion

Discussion Use this property to specify the search bar placement. If the value of the property is UINavigationItem.SearchBarPlacement.automatic, use the searchBarPlacement property to determine the actual placement. The default value of this property is UINavigationItem.SearchBarPlacement.automatic. This property only applies when the navigation item has a searchController.

## See Also

### Integrating search into your interface

- [searchController](uikit/uinavigationitem/searchcontroller.md)
- [hidesSearchBarWhenScrolling](uikit/uinavigationitem/hidessearchbarwhenscrolling.md)
- [searchBarPlacement](uikit/uinavigationitem/searchbarplacement-swift.property.md)
- [UINavigationItem.SearchBarPlacement](uikit/uinavigationitem/searchbarplacement-swift.enum.md)
- [searchBarPlacementAllowsExternalIntegration](uikit/uinavigationitem/searchbarplacementallowsexternalintegration.md)
- [searchBarPlacementAllowsToolbarIntegration](uikit/uinavigationitem/searchbarplacementallowstoolbarintegration.md)
- [searchBarPlacementBarButtonItem](uikit/uinavigationitem/searchbarplacementbarbuttonitem.md)
