<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITabBarItem/badgeTextAttributes(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UITabBarItem(im)badgeTextAttributesForState:"
  },
  "title" : "badgeTextAttributes(for:)"
}
-->

# badgeTextAttributes(for:)

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

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

## Parameters

`state`

The item’s state. For possible values, see [`UIControl.State`](/documentation/UIKit/UIControl/State-swift.struct).

## 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 <doc://com.apple.documentation/documentation/Foundation/NSAttributedString/Key>.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)