Class

UIBar​Item

UIBar​Item is an abstract superclass for items added to a bar that appears at the bottom of the screen. Items on a bar behave in a way similar to buttons (instances of UIButton). They have a title, image, action, and target. You can also enable and disable an item on a bar.

Overview

Customizing Appearance

You can customize the image to represent the item, and the position of the image, using imageand image​Insets respectively.

In iOS v5.0 and later, you can also specify a custom image and position to use in landscape orientation when using the iPhone appearance idiom using landscape​Image​Phoneand landscape​Image​Phone​Insets respectively. In addition, you can customize the title’s text attributes using set​Title​Text​Attributes(_:​for:​), either for a single item, or for all items by using the appearance proxy (for example, [UIBar​Item appearance]).

Symbols

Getting and Setting Properties

var is​Enabled:​ Bool

A Boolean value indicating whether the item is enabled.

var image:​ UIImage?

The image used to represent the item.

var landscape​Image​Phone:​ UIImage?

The image to use to represent the item in landscape orientation when using the iPhone appearance idiom.

var image​Insets:​ UIEdge​Insets

The image inset or outset for each edge.

var landscape​Image​Phone​Insets:​ UIEdge​Insets

The image inset or outset for each edge of the image in landscape orientation when using the iPhone appearance idiom.

var title:​ String?

The title displayed on the item.

var tag:​ Int

The receiver’s tag, an application-supplied integer that you can use to identify bar item objects in your application.

Customizing Appearance

func set​Title​Text​Attributes([String :​ Any]?, for:​ UIControl​State)

Sets the title’s text attributes for a given control state.

func title​Text​Attributes(for:​ UIControl​State)

Returns the title’s text attributes for a given control state.