Contents

init(title:image:tag:)

Creates a tab bar item that displays a title and an image.

Declaration

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

Parameters

  • title:

    The item’s title.

  • image:

    The item’s source image.

  • tag:

    An integer you use to identify the object.

Discussion

Use nil for title or image to not display that element.

By default, the item displays the same image regardless of its selected state. To display a different image for the selected state, set its selectedImage property. The item creates the images it displays from the alpha values in the source images. To prevent system tinting, use images with the UIImage.RenderingMode.alwaysOriginal rendering mode. The item clips any image that’s larger than its bounds.

See Also

Creating a tab bar item