---
title: "position(for:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uibarpositioningdelegate/position(for:)"
---

# position(for:)

Asks the delegate for the position of the specified bar in its new window.

## Declaration

```swift
optional func position(for bar: any UIBarPositioning) -> UIBarPosition
```

## Parameters

- `bar`: The bar that was added to the window.

## Return Value

Return Value The position of the bar.

## Discussion

Discussion If your interface has a custom bar with a delegate, that delegate can implement this method and use it to specify the position of the bar that has been added to a window. Delegates for the UINavigationBar and UISearchBar classes return the value UIBarPosition.top by default. The delegate of the UIToolbar class returns the value UIBarPosition.bottom by default.

## See Also

### Related Documentation

- [UIBarPositioning](uikit/uibarpositioning.md)
