<!--
{
  "availability" : [
    "iOS: 9.1.0 -",
    "iPadOS: 9.1.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UISearchContainerViewController/init(searchController:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UISearchContainerViewController(im)initWithSearchController:"
  },
  "title" : "init(searchController:)"
}
-->

# init(searchController:)

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

```
init(searchController: UISearchController)
```

## Parameters

`searchController`

The search controller managing the search results. This parameter must not be `nil`.

## Return Value

An initialized search container view controller.

## Discussion

After initializing the search container view controller, embed it in your container view controller normally.

---

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)