<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIBarPositioning",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIBarPositioning"
  },
  "title" : "UIBarPositioning"
}
-->

# UIBarPositioning

A set of methods for defining the positioning of bars in iOS apps.

```
@MainActor protocol UIBarPositioning : NSObjectProtocol
```

## Overview

Bars can be positioned at the bottom of their enclosing view, at the top of their enclosing view, or at both the top of their enclosing view and also the top of the screen. In this last case, the bar will abut the status bar displayed by the system. Bars in this position need to have their background extend above their own frame to the top of the screen. This allows the background to show through the status bar.

The classes that implement bars have paired methods to set a background for a given position and set of metrics. These are named similar to the following: [`backgroundImage(for:barMetrics:)`](/documentation/UIKit/UISearchBar/backgroundImage(for:barMetrics:)) and [`setBackgroundImage(_:for:barMetrics:)`](/documentation/UIKit/UISearchBar/setBackgroundImage(_:for:barMetrics:)). Use these methods to set an appropriate background image for the different possible bar positions and metrics.

## Topics

### Accessing the bar position

[`barPosition`](/documentation/UIKit/UIBarPositioning/barPosition)

The position of the bar.

### Constants

[`UIBarMetrics`](/documentation/UIKit/UIBarMetrics)

Constants to specify metrics to use for appearance.

[`UIBarPosition`](/documentation/UIKit/UIBarPosition)

Constants to identify the position of a bar.



---

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)