<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIBarButtonItemStateAppearance",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIBarButtonItemStateAppearance"
  },
  "title" : "UIBarButtonItemStateAppearance"
}
-->

# UIBarButtonItemStateAppearance

A data object containing the specific customizations for a bar button item in a particular state.

```
@MainActor class UIBarButtonItemStateAppearance
```

## Overview

Use a [`UIBarButtonItemStateAppearance`](/documentation/UIKit/UIBarButtonItemStateAppearance) object to customize the title and background image of your bar button items. Don’t create [`UIBarButtonItemStateAppearance`](/documentation/UIKit/UIBarButtonItemStateAppearance) objects yourself. Instead, create a [`UIBarButtonItemAppearance`](/documentation/UIKit/UIBarButtonItemAppearance) object and use its properties to fetch the appearance attributes for the button in a particular state. For example, to set the button’s attributes when it’s in the normal state, configure the object in the [`normal`](/documentation/UIKit/UIBarButtonItemAppearance/normal) property.

## Topics

### Configuring the title

[`var titleTextAttributes: [NSAttributedString.Key : Any]`](/documentation/UIKit/UIBarButtonItemStateAppearance/titleTextAttributes)

String attributes to apply to the text of the bar button item’s title.

[`var titlePositionAdjustment: UIOffset`](/documentation/UIKit/UIBarButtonItemStateAppearance/titlePositionAdjustment)

The additional amount by which to offset the title horizontally and vertically.

### Configuring the background appearance

[`var backgroundImage: UIImage?`](/documentation/UIKit/UIBarButtonItemStateAppearance/backgroundImage)

A background image to display around the button.

[`var backgroundImagePositionAdjustment: UIOffset`](/documentation/UIKit/UIBarButtonItemStateAppearance/backgroundImagePositionAdjustment)

The distance, in points, by which to offset the background image horizontally and vertically.

## Relationships

### Conforms To

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Equatable`](/documentation/Swift/Equatable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Hashable`](/documentation/Swift/Hashable)

[`Sendable`](/documentation/Swift/Sendable)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)