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

# primaryAction

The action associated with the item.

```
@NSCopying var primaryAction: UIAction? { get set }
```

## Discussion

When you assign a new value to this property, the title and image of the item update to match the primary action’s [`title`](/documentation/UIKit/UIAction/title) and [`image`](/documentation/UIKit/UIAction/image).

If this property has a non-`nil` value, the system ignores the item’s [`target`](/documentation/UIKit/UIBarButtonItem/target) and [`action`](/documentation/UIKit/UIBarButtonItem/action) properties.

---

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)