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

# setDelegate(_:queue:)

Sets the receiver’s delegate and a dispatch queue on which the delegate is called.

## Declaration

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

## Parameters

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

## Discussion

Discussion Because the delegate is held using a zeroing-weak reference, it is safe to deallocate the delegate while the receiver still has a reference to it.

## See Also

### Configuring the delegate

- [delegate](avfoundation/avplayeritemlegibleoutput/delegate.md)
- [AVPlayerItemLegibleOutputPushDelegate](avfoundation/avplayeritemlegibleoutputpushdelegate.md)
- [advanceIntervalForDelegateInvocation](avfoundation/avplayeritemlegibleoutput/advanceintervalfordelegateinvocation.md)
- [delegateQueue](avfoundation/avplayeritemlegibleoutput/delegatequeue.md)
