---
title: "willPresentSearchController(_:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uisearchcontrollerdelegate/willpresentsearchcontroller(_:)"
---

# willPresentSearchController(_:)

Notifies the delegate that the system is about to automatically display the search controller.

## Declaration

```swift
optional func willPresentSearchController(_ searchController: UISearchController)
```

## Parameters

- `searchController`: The doc://com.apple.uikit/documentation/UIKit/UISearchController object to present.

## Discussion

Discussion The system only calls this method when it’s about to automatically present the search controller. The system doesn’t call this method when you explicitly present the search controller.

## See Also

### Presenting and dismissing the search controller

- [didDismissSearchController(_:)](uikit/uisearchcontrollerdelegate/diddismisssearchcontroller(_:).md)
- [didPresentSearchController(_:)](uikit/uisearchcontrollerdelegate/didpresentsearchcontroller(_:).md)
- [presentSearchController(_:)](uikit/uisearchcontrollerdelegate/presentsearchcontroller(_:).md)
- [willDismissSearchController(_:)](uikit/uisearchcontrollerdelegate/willdismisssearchcontroller(_:).md)
