<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIBarButtonItem/identifier",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIBarButtonItem(py)identifier"
  },
  "title" : "identifier"
}
-->

# identifier

An identifier used to match bar button items across transitions in a navigation bar or toolbar.

```
var identifier: String? { get set }
```

## Discussion

When the set of bar button items in a navigation bar or toolbar changes (for example, when pushing
or popping view controllers), UIKit automatically animates the transition between the different sets
of items. By default, UIKit uses heuristics based on item position and content to determine which items
should be matched for these transitions.

Set this property with the same value on two different bar button items in different navigation item
configurations to indicate that they should be treated as the same item during transitions. This allows
for more natural animations when the visuals or function of an item changes across contexts.

The default value is `nil`, which means UIKit will use its default heuristics for transitions.

---

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)