Instance Method

initWithTitle:image:selectedImage:

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

Declaration

- (instancetype)initWithTitle:(NSString *)title image:(UIImage *)image selectedImage:(UIImage *)selectedImage;

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 UIImageRenderingModeAlwaysOriginal.

See Also

Initializing an Item

- initWithTabBarSystemItem:tag:

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

- initWithTitle:image:tag:

Creates and returns a new item using the specified properties.

- init

Initializes the tab bar item to its default state.

UITabBarSystemItem

System items that can be used on a tab bar.