<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVCaptureTimecodeGenerator/setDelegate(_:queue:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCaptureTimecodeGenerator(im)setDelegate:queue:"
  },
  "title" : "setDelegate(_:queue:)"
}
-->

# setDelegate(_:queue:)

Assigns a delegate to receive real-time timecode updates and specifies a queue for callbacks.

```
func setDelegate(_ delegate: (any AVCaptureTimecodeGeneratorDelegate)?, queue callbackQueue: dispatch_queue_t?)
```

## Parameters

`delegate`

An object conforming to the [`AVCaptureTimecodeGeneratorDelegate`](/documentation/AVFoundation/AVCaptureTimecodeGeneratorDelegate) protocol.

`callbackQueue`

The dispatch queue on which the delegate methods are invoked. The `callbackQueue` parameter may not be `nil`, except when setting the [`AVCaptureTimecodeGeneratorDelegate`](/documentation/AVFoundation/AVCaptureTimecodeGeneratorDelegate) to `nil`, otherwise [`setDelegate(_:queue:)`](/documentation/AVFoundation/AVCaptureTimecodeGenerator/setDelegate(_:queue:)) throws an `NSInvalidArgumentException`.

## Discussion

Use this method to configure a delegate that handles timecode updates. The specified `queue` ensures thread-safe invocation of delegate methods.

---

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)