UIBarPositioningDelegate Protocol Reference

Conforms to
Framework
/System/Library/Frameworks/UIKit.framework
Availability
Available in iOS 7.0 and later.
Companion guide
Declared in
UIBarCommon.h

Overview

The UIBarPositioningDelegate protocol supports the positioning of a bar that conforms to the UIBarPositioning protocol. Navigation bars, toolbars, and search bars all have delegates that support this protocol. The delegate can use the method of this protocol to specify the bar’s position when that bar is moved to a window.

The UINavigationBarDelegate, UISearchBarDelegate, and UIToolbarDelegate protocols extend this protocol to allow for the positioning of those bars on the screen.

Tasks

Positioning Bars

Instance Methods

positionForBar:

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

- (UIBarPosition)positionForBar:(id<UIBarPositioning>)bar
Parameters
bar

The bar that was added to the window.

Return Value

The position of the bar.

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 UIBarPositionTop by default. The delegate of the UIToolbar class returns the value UIBarPositionBottom by default.

Availability
  • Available in iOS 7.0 and later.
Declared In
UIBarCommon.h