A view controller that manages the presentation of search results in your interface.


class UISearchContainerViewController : UIViewController


Although you can present a search controller object modally, you should never push one onto a navigation controller’s stack or use one as a child of another container view controller. Instead, embed an instance of this class and let it manage the presentation of the search controller’s content.


Initializing a Search Container View Controller

init(searchController: UISearchController)

Initializes and returns a search container view controller with the specified search controller object.

Getting the Search Controller

var searchController: UISearchController

The search controller being managed.

See Also

Search Interface

class UISearchController

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

class UISearchBar

A specialized view for receiving search-related information from the user.

protocol UISearchResultsUpdating

A set of methods that let you update search results based on information the user enters into the search bar.

Displaying Searchable Content by Using a Search Controller

Create a user interface with searchable content in a table view.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software