The UIBar​Positioning protocol defines the ways that bars can be positioned on iOS devices. 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: background​Image(for:​bar​Metrics:​) and set​Background​Image(_:​for:​bar​Metrics:​). Use these methods to set an appropriate background image for the different possible bar positions and metrics.


Accessing the Bar Position



Constants to specify metrics to use for appearance.


Constants to identify the position of a bar.


Inherits From