---
title: "setDelegate(_:queue:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avplayeritemmetadatacollector/setdelegate(_:queue:)"
---

# setDelegate(_:queue:)

Sets the delegate and a dispatch queue on which the delegate will be called.

## Declaration

```swift
func setDelegate(_ delegate: (any AVPlayerItemMetadataCollectorPushDelegate)?, queue delegateQueue: dispatch_queue_t?)
```

## Parameters

- `delegate`: An object conforming to doc://com.apple.avfoundation/documentation/AVFoundation/AVPlayerItemMetadataCollectorPushDelegate protocol.
- `delegateQueue`: A dispatch queue on which all delegate methods will be called.

## See Also

### Accessing the delegate and callback queue

- [delegate](avfoundation/avplayeritemmetadatacollector/delegate.md)
- [AVPlayerItemMetadataCollectorPushDelegate](avfoundation/avplayeritemmetadatacollectorpushdelegate.md)
- [delegateQueue](avfoundation/avplayeritemmetadatacollector/delegatequeue.md)
