<!--
{
  "availability" : [
    "iOS: 17.4.0 -",
    "iPadOS: 17.4.0 -",
    "macCatalyst: 17.4.0 -",
    "macOS: 14.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "DockKit",
  "identifier" : "/documentation/DockKit/DockAccessory/AccessoryEvent/button(id:pressed:)",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "DockKit"
    ],
    "preciseIdentifier" : "s:7DockKit0A9AccessoryC0C5EventO6buttonyAESi_SbtcAEmF"
  },
  "title" : "DockAccessory.AccessoryEvent.button(id:pressed:)"
}
-->

# DockAccessory.AccessoryEvent.button(id:pressed:)

A button press event on the dock accessory.

```
case button(id: Int, pressed: Bool)
```

## Parameters

`id`

A unique, vendor-specific identifier for the given button.

`pressed`

`true` on button press down, `false` on button release up.

---

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)