<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UISearchControllerDelegate/searchController(_:willChangeTo:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UISearchControllerDelegate(im)searchController:willChangeToSearchBarPlacement:"
  },
  "title" : "searchController(_:willChangeTo:)"
}
-->

# searchController(_:willChangeTo:)

Notifies the delegate before the search bar placement changes.

```
optional func searchController(_ searchController: UISearchController, willChangeTo newPlacement: UINavigationItem.SearchBarPlacement)
```

## Parameters

`searchController`

The search controller associated with the search bar.

`newPlacement`

The new search bar placement.

## Discussion

The system calls this method before a search bar placement change occurs, such as in response to a layout change that alters the amount of available space in the navigation bar. Implement this method if you need to make any custom changes to your search suggestions UI according to the new search bar placement.

The system calls this method before [`searchController(_:didChangeFrom:)`](/documentation/UIKit/UISearchControllerDelegate/searchController(_:didChangeFrom:)).

---

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)