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

# hidesSearchBarWhenScrolling

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

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

## Discussion

When the value of this property is <doc://com.apple.documentation/documentation/Swift/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 <doc://com.apple.documentation/documentation/Swift/false>, the search bar remains regardless of the current scroll position.

You must configure the [`searchController`](/documentation/UIKit/UINavigationItem/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.

---

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)