---
title: delegate
framework: virtualization
role: symbol
role_heading: Instance Property
path: virtualization/vzcustomvirtiodevice/delegate
---

# delegate

The device’s delegate.

## Declaration

```swift
weak var delegate: (any VZCustomVirtioDeviceDelegate)? { get set }
```

## Discussion

Discussion To be able to respond to events from a VZCustomVirtioDevice, implement a class that conforms to the VZCustomVirtioDeviceDelegate protocol and assign it to this property. You can call the delegate as soon as customVirtioConfiguration(_:didCreateDevice:) returns, to avoid missing any calls, set this delegate when the framework calls customVirtioConfiguration(_:didCreateDevice:).
