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

# changesSelectionAsPrimaryAction

A Boolean value that indicates whether the button represents an action or selection.

```
var changesSelectionAsPrimaryAction: Bool { get set }
```

## Discussion

When a button has this property set to <doc://com.apple.documentation/documentation/Swift/true>, the button changes to a toggle button where tapping it changes it between selected and unselected.

---

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)