---
title: UISearchController
framework: uikit
role: symbol
role_heading: Class
path: uikit/uisearchcontroller
---

# UISearchController

A view controller that manages the display of search results based on interactions with a search bar.

## Declaration

```swift
@MainActor class UISearchController
```

## Overview

Overview Use a search controller to provide a standard search experience of the contents of another view controller. When the user interacts with a UISearchBar, the search controller coordinates with a search results controller to display the search results. In iOS, incorporate the search controller’s searchBar into your own view controller’s interface. Display your view controller in whatever way is appropriate for your app. See Displaying searchable content by using a search controller and Using suggested searches with a search controller to learn how to implement a search controller in your app. In tvOS, start with a UISearchContainerViewController to manage the presentation of the search controller. See UIKit Catalog (tvOS): Creating and Customizing UIKit Controls to learn how to implement a search controller embedded inside a UISearchContainerViewController object. note: Don’t use a UISearchContainerViewController in iOS. Display search results Specify a second view controller for displaying search results when you call init(searchResultsController:). When the user interacts with the search bar, the search controller automatically displays the results controller with the results you specify. If your results view is full-screen in tvOS, set the searchControllerObservedScrollView to the results controller as well, so the search bar scrolls with your content view. Provide a UISearchResultsUpdating object to the search controller’s searchResultsUpdater property. Typically, the view controller with your searchable content also acts as the search results updater object, but you can use another object if you prefer. When the user interacts with the search bar, the search controller calls the appropriate UISearchResultsUpdating method, giving your object the opportunity to perform the search and update the contents of your search results view. Customize transitions To customize the presentation or dismissal of the search results controller, set the search controller’s delegate property to an object that conforms to the UISearchControllerDelegate protocol. Then implement delegate methods in this object to receive presentation and dismissal events from the search controller.

## Topics

### Creating a search controller

- [init(searchResultsController:)](uikit/uisearchcontroller/init(searchresultscontroller:).md)
- [init(coder:)](uikit/uisearchcontroller/init(coder:).md)
- [init(nibName:bundle:)](uikit/uisearchcontroller/init(nibname:bundle:).md)

### Responding to presentation and dismissal

- [delegate](uikit/uisearchcontroller/delegate.md)
- [UISearchControllerDelegate](uikit/uisearchcontrollerdelegate.md)

### Managing the search results

- [searchBar](uikit/uisearchcontroller/searchbar.md)
- [searchResultsUpdater](uikit/uisearchcontroller/searchresultsupdater.md)
- [searchResultsController](uikit/uisearchcontroller/searchresultscontroller.md)
- [isActive](uikit/uisearchcontroller/isactive.md)

### Configuring the search interface

- [obscuresBackgroundDuringPresentation](uikit/uisearchcontroller/obscuresbackgroundduringpresentation.md)
- [hidesNavigationBarDuringPresentation](uikit/uisearchcontroller/hidesnavigationbarduringpresentation.md)
- [automaticallyShowsCancelButton](uikit/uisearchcontroller/automaticallyshowscancelbutton.md)
- [automaticallyShowsSearchResultsController](uikit/uisearchcontroller/automaticallyshowssearchresultscontroller.md)
- [showsSearchResultsController](uikit/uisearchcontroller/showssearchresultscontroller.md)
- [searchBarPlacement](uikit/uisearchcontroller/searchbarplacement.md)
- [ignoresSearchSuggestionsForSearchBarPlacementStacked](uikit/uisearchcontroller/ignoressearchsuggestionsforsearchbarplacementstacked.md)
- [automaticallyShowsScopeBar](uikit/uisearchcontroller/automaticallyshowsscopebar.md)
- [scopeBarActivation](uikit/uisearchcontroller/scopebaractivation-swift.property.md)
- [UISearchController.ScopeBarActivation](uikit/uisearchcontroller/scopebaractivation-swift.enum.md)

### Providing search suggestions

- [searchSuggestions](uikit/uisearchcontroller/searchsuggestions.md)
- [ignoresSearchSuggestionsForSearchBarPlacementStacked](uikit/uisearchcontroller/ignoressearchsuggestionsforsearchbarplacementstacked.md)
- [UISearchSuggestionItem](uikit/uisearchsuggestionitem.md)
- [UISearchSuggestion](uikit/uisearchsuggestion.md)

### Deprecated

- [searchControllerObservedScrollView](uikit/uisearchcontroller/searchcontrollerobservedscrollview.md)
- [dimsBackgroundDuringPresentation](uikit/uisearchcontroller/dimsbackgroundduringpresentation.md)

## Relationships

### Inherits From

- [UIViewController](uikit/uiviewcontroller.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSExtensionRequestHandling](foundation/nsextensionrequesthandling.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSTouchBarProvider](appkit/nstouchbarprovider.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [UIActivityItemsConfigurationProviding](uikit/uiactivityitemsconfigurationproviding.md)
- [UIAppearanceContainer](uikit/uiappearancecontainer.md)
- [UIContentContainer](uikit/uicontentcontainer.md)
- [UIFocusEnvironment](uikit/uifocusenvironment.md)
- [UIPasteConfigurationSupporting](uikit/uipasteconfigurationsupporting.md)
- [UIResponderStandardEditActions](uikit/uiresponderstandardeditactions.md)
- [UIStateRestoring](uikit/uistaterestoring.md)
- [UITraitChangeObservable](uikit/uitraitchangeobservable-67e94.md)
- [UITraitEnvironment](uikit/uitraitenvironment.md)
- [UIUserActivityRestoring](uikit/uiuseractivityrestoring.md)
- [UIViewControllerAnimatedTransitioning](uikit/uiviewcontrolleranimatedtransitioning.md)
- [UIViewControllerTransitioningDelegate](uikit/uiviewcontrollertransitioningdelegate.md)

## See Also

### Search interface

- [UISearchContainerViewController](uikit/uisearchcontainerviewcontroller.md)
- [UISearchBar](uikit/uisearchbar.md)
- [UISearchResultsUpdating](uikit/uisearchresultsupdating.md)
- [Displaying searchable content by using a search controller](uikit/displaying-searchable-content-by-using-a-search-controller.md)
- [Using suggested searches with a search controller](uikit/using-suggested-searches-with-a-search-controller.md)
