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

# willDismissSearchController(_:)

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

```
optional func willDismissSearchController(_ searchController: UISearchController)
```

## Parameters

`searchController`

The [`UISearchController`](/documentation/UIKit/UISearchController) object to dismiss.

## Discussion

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

---

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)