<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AccessorySetupKit",
  "identifier" : "/documentation/AccessorySetupKit/ASAccessorySession/activate(on:eventHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AccessorySetupKit"
    ],
    "preciseIdentifier" : "c:objc(cs)ASAccessorySession(im)activateWithQueue:eventHandler:"
  },
  "title" : "activate(on:eventHandler:)"
}
-->

# activate(on:eventHandler:)

Activate the session and start delivering events to an event handler.

```
func activate(on queue: dispatch_queue_t, eventHandler: @escaping (ASAccessoryEvent) -> Void)
```

## Parameters

`queue`

The dispatch the session uses to deliver events to `eventHandler`.

`eventHandler`

A closure or block that receives events generated by the session. Each callback to the event handler provides an [`ASAccessoryEvent`](/documentation/AccessorySetupKit/ASAccessoryEvent) as a parameter, and expects no return value.

---

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)