Initializer

init(title:image:selectedImage:)

Creates and returns a new item with the specified title, unselected image, and selected image.

Declaration

convenience init(title: String?, image: UIImage?, selectedImage: UIImage?)

Parameters

title

The item’s title. If nil, a title is not displayed.

image

The item’s unselected image. If nil, an image is not displayed.

selectedImage

The item’s selected image. If nil, uses the value of image.

Return Value

Newly initialized item with the specified title, unselected image, and selected image.

Discussion

If no selectedImage is provided, image is used as both the unselected and selected image.

By default, the actual unselected and selected images are automatically created from the alpha values in the source images. To prevent system coloring, provide images with UIImage.RenderingMode.alwaysOriginal.

See Also

Initializing an Item

init(tabBarSystemItem: UITabBarItem.SystemItem, tag: Int)

Creates and returns a new item containing the specified system item.

init(title: String?, image: UIImage?, tag: Int)

Creates and returns a new item using the specified properties.

init()

Initializes the tab bar item to its default state.

enum UITabBarItem.SystemItem

System items that can be used on a tab bar.