---
title: "badgeTextAttributes(for:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitabbaritem/badgetextattributes(for:)"
---

# badgeTextAttributes(for:)

Returns the badge’s text attributes for the specified state.

## Declaration

```swift
func badgeTextAttributes(for state: UIControl.State) -> [NSAttributedString.Key : Any]?
```

## Parameters

- `state`: The item’s state. For possible values, see doc://com.apple.uikit/documentation/UIKit/UIControl/State-swift.struct.

## Discussion

Discussion Use this method to retrieve the attributes the item applies to its badge’s value for the specified state. For a list of attributes, see NSAttributedString.Key.

## See Also

### Configuring the item’s badge

- [badgeValue](uikit/uitabbaritem/badgevalue.md)
- [badgeColor](uikit/uitabbaritem/badgecolor.md)
- [setBadgeTextAttributes(_:for:)](uikit/uitabbaritem/setbadgetextattributes(_:for:).md)
