Contents

setBadgeTextAttributes(_:for:)

Registers text attributes that the badge uses for the specified state.

Declaration

func setBadgeTextAttributes(_ textAttributes: [NSAttributedString.Key : Any]?, for state: UIControl.State)

Parameters

  • textAttributes:

    A dictionary of text attributes. For a list of possible attributes, see Key.

  • state:

    The item’s state. For possible values, see State Swift.struct.

Discussion

The setTitleTextAttributes(_:for:) method allows you to customize the appearance of the item’s title. Use this method to apply similar customizations to the badge’s value to achieve a consistent appearance.

See Also

Configuring the item’s badge