<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UINavigationItem/SearchBarPlacement-swift.enum",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:@E@UINavigationItemSearchBarPlacement"
  },
  "title" : "UINavigationItem.SearchBarPlacement"
}
-->

# UINavigationItem.SearchBarPlacement

Constants that determine where the search bar appears in the navigation bar.

```
enum SearchBarPlacement
```

## Overview

Use these constants to specify the placement of the search bar that belongs to the navigation item’s search controller ([`searchController`](/documentation/UIKit/UINavigationItem/searchController)).

## Topics

### Constants

[`case automatic`](/documentation/UIKit/UINavigationItem/SearchBarPlacement-swift.enum/automatic)

A constant that places the search bar according to the current layout.

[`static var inline: UINavigationItem.SearchBarPlacement`](/documentation/UIKit/UINavigationItem/SearchBarPlacement-swift.enum/inline)

A constant that places the search bar on the trailing edge of the navigation bar, inline with the other content.

[`case stacked`](/documentation/UIKit/UINavigationItem/SearchBarPlacement-swift.enum/stacked)

A constant that stacks the search bar vertically below the other content in the navigation bar.

### Enumeration Cases

[`case integrated`](/documentation/UIKit/UINavigationItem/SearchBarPlacement-swift.enum/integrated)

The navigation bar will place the search bar inline with other content, on the trailing edge.
On iPhone, when the navigation bar belongs to a UINavigationController, the search bar may be integrated into the toolbar.

[`case integratedButton`](/documentation/UIKit/UINavigationItem/SearchBarPlacement-swift.enum/integratedButton)

Placement is the same as Integrated, except that the inactive search bar is always shown as a button even when space permits a search field.

[`case integratedCentered`](/documentation/UIKit/UINavigationItem/SearchBarPlacement-swift.enum/integratedCentered)

Placement is the same as Integrated, except that in regular width on iPad, the search bar is centered in the navigation bar.
Only respected when used in a view controller that is a descendant of a tab bar controller or when using a navigation item style that requires a leading aligned title

### Initializers

[`init?(rawValue: Int)`](/documentation/UIKit/UINavigationItem/SearchBarPlacement-swift.enum/init(rawValue:))

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`Sendable`](/documentation/Swift/Sendable)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

---

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)