<!--
{
  "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/UISearchController/init(searchResultsController:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UISearchController(im)initWithSearchResultsController:"
  },
  "title" : "init(searchResultsController:)"
}
-->

# init(searchResultsController:)

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

```
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

An initialized search controller.

## Discussion

After creating the search controller, always assign an object to the [`searchResultsUpdater`](/documentation/UIKit/UISearchController/searchResultsUpdater) property. The search controller uses that object to update the search results.

---

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)