<!--
{
  "availability" : [
    "macOS: 15.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreHID",
  "identifier" : "/documentation/CoreHID/HIDVirtualDevice/activate(delegate:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core HID"
    ],
    "preciseIdentifier" : "s:7CoreHID16HIDVirtualDeviceC8activate8delegateyAA0cD8Delegate_p_tF"
  },
  "title" : "activate(delegate:)"
}
-->

# activate(delegate:)

Activate a newly created virtual device to begin receiving notifications and enable functionality.

```
func activate(delegate: any HIDVirtualDeviceDelegate)
```

## Parameters

`delegate`

The [`HIDVirtualDeviceDelegate`](/documentation/CoreHID/HIDVirtualDeviceDelegate) that receives incoming set/get report requests. Only one delegate is associated with the device, but many devices can be associated with the delegate.

## Discussion

Many functions won’t run, and notifications won’t be received using the [`HIDVirtualDeviceDelegate`](/documentation/CoreHID/HIDVirtualDeviceDelegate) until activate has run successfully. A device cannot be activated twice.

---

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)