---
title: hidesSearchBarWhenScrolling
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uinavigationitem/hidessearchbarwhenscrolling
---

# hidesSearchBarWhenScrolling

A Boolean value that indicates whether the app hides the integrated search bar when scrolling any underlying content.

## Declaration

```swift
var hidesSearchBarWhenScrolling: Bool { get set }
```

## Discussion

Discussion When the value of this property is true, the search bar is visible only when the scroll position equals the top of your content view. When the user scrolls down, the search bar collapses into the navigation bar. Scrolling back to the top reveals the search bar again. When the value of this property is false, the search bar remains regardless of the current scroll position. You must configure the searchController property for this property to have any effect. The navigation controller hides and shows only the search bar provided by the search controller in that property.

## See Also

### Integrating search into your interface

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