Contents

UIBarButtonItem

A specialized button for placement on a toolbar, navigation bar, or shortcuts bar.

Declaration

@MainActor class UIBarButtonItem

Mentioned in

Overview

You typically use Interface Builder to create and configure bar button items. However, you can customize the appearance of buttons by sending the setter messages to UIBarButtonItemAppearance to customize all buttons, or to a specific UIBarButtonItem instance. You can use customized buttons in standard places in a UINavigationItem object or a UIToolbar instance.

In general, specify a value for the normal state so that other states without a custom value set can use it. Similarly, when a property depends on the bar metrics (for instance, on the iPhone in landscape orientation, bars have a different height from the standard), specify a value of UIBarMetrics.default.

Topics

Creating items

Creating items of a specific style

Creating system items

Creating custom items

Creating space items

Creating groups

Managing the custom view

Managing the action

Managing the context menu

Customizing item appearance

Customizing the Back button

Customizing the background

Customizing the title placement

Configuring symbol effects

Getting the group

Representing the item in a menu

Adding a badge

Customizing placement in a toolbar

Instance Properties

See Also

Bars