Instance Method

setBadgeTextAttributes:forState:

Assigns custom text attributes to the badge text.

Declaration

- (void)setBadgeTextAttributes:(NSDictionary<NSAttributedStringKey, id> *)textAttributes forState:(UIControlState)state;

Parameters

textAttributes

The attributed string attributes that you want to apply to the badge text. For example, you might specify custom font or color information for your text. For a list of attributes that you can apply, see Character Attributes in NSAttributedString.

state

The state for which to apply the attributes. The possible values are described in UIControlState.

Discussion

Use this method to apply custom attributes to the text in the badgeValue property. You might apply custom attributes so that your badge text matches the appearance of the item text.

See Also

Configuring the Badge

badgeValue

Text that is displayed in the upper-right corner of the item with a surrounding red oval.

badgeColor

The background color to apply to the badge.

- badgeTextAttributesForState:

Retrieves the custom text attributes associated with the item's badge text.