---
title: "activate(delegate:)"
framework: corehid
role: symbol
role_heading: Instance Method
path: "corehid/hidvirtualdevice/activate(delegate:)"
---

# activate(delegate:)

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

## Declaration

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

## Parameters

- `delegate`: The doc://com.apple.CoreHID/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

Discussion Many functions won’t run, and notifications won’t be received using the HIDVirtualDeviceDelegate until activate has run successfully. A device cannot be activated twice.

## See Also

### Create a HID virtual device

- [init(properties:)](corehid/hidvirtualdevice/init(properties:).md)
- [deviceReference](corehid/hidvirtualdevice/devicereference.md)
