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

# setDelegate(_:queue:)

Sets the delegate and dispatch queue to use with the resource loader.

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

## Parameters

`delegate`

The delegate object to query when handling resource requests. You may specify `nil` if you want to clear the delegate object. The resource loader does not store a strong reference to the delegate object.

`delegateQueue`

The dispatch queue on which to execute resource requests. If the `delegate` parameter is not `nil`, this parameter must also not be `nil` and must contain a valid dispatch queue. However, if `delegate` is `nil`, this parameter may also be `nil`.

    The resource loader maintains a strong reference to the dispatch queue you specify.

## Discussion

You use this method to specify the object to use when handling resource requests and the dispatch queue on which to process those requests. Resource requests are processed synchronously on the dispatch queue you provide.

---

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)