---
title: "init(searchResultsController:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/uisearchcontroller/init(searchresultscontroller:)"
---

# init(searchResultsController:)

Creates and returns a search controller with the specified view controller for displaying the results.

## Declaration

```swift
init(searchResultsController: UIViewController?)
```

## Parameters

- `searchResultsController`: The view controller that displays the search results. Specify nil if you want to display the search results in the same view controller that displays your searchable content. For apps running in tvOS, provide a results controller because tvOS doesn’t accept nil as a valid argument.

## Return Value

Return Value An initialized search controller.

## Discussion

Discussion After creating the search controller, always assign an object to the searchResultsUpdater property. The search controller uses that object to update the search results.

## See Also

### Creating a search controller

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