<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.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/AVAssetResourceLoadingDataRequest",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAssetResourceLoadingDataRequest"
  },
  "title" : "AVAssetResourceLoadingDataRequest"
}
-->

# AVAssetResourceLoadingDataRequest

An object for requesting data from a resource that an asset resource-loading request references.

```
class AVAssetResourceLoadingDataRequest
```

## Overview

The [`AVAssetResourceLoaderDelegate`](/documentation/AVFoundation/AVAssetResourceLoaderDelegate) uses the `AVAssetResourceLoadingDataRequest` class to do the actual data reading, and its methods will be invoked, as necessary, to acquire data for the [`AVAssetResourceLoadingRequest`](/documentation/AVFoundation/AVAssetResourceLoadingRequest) instance.

When the resource loading delegate, which implements the [`AVAssetResourceLoaderDelegate`](/documentation/AVFoundation/AVAssetResourceLoaderDelegate) protocol, receives an instance of [`AVAssetResourceLoadingRequest`](/documentation/AVFoundation/AVAssetResourceLoadingRequest) as the second parameter of the delegate’s [`resourceLoader(_:shouldWaitForLoadingOfRequestedResource:)`](/documentation/AVFoundation/AVAssetResourceLoaderDelegate/resourceLoader(_:shouldWaitForLoadingOfRequestedResource:)) method, it has the option of accepting responsibility for loading the referenced resource. If it accepts that responsibility, by returning <doc://com.apple.documentation/documentation/Swift/true>, it must check whether the [`dataRequest`](/documentation/AVFoundation/AVAssetResourceLoadingRequest/dataRequest) property of the [`AVAssetResourceLoadingRequest`](/documentation/AVFoundation/AVAssetResourceLoadingRequest) instance is not `nil`. If it is not `nil`, the resource loading delegate is informed of the range of bytes within the resource that are required by the underlying media system. In response, the data is provided by one or more invocations of [`respond(with:)`](/documentation/AVFoundation/AVAssetResourceLoadingDataRequest/respond(with:)) as required to provide the requested data. The data can be provided in increments determined by the resource loading delegate according to convenience or efficiency.

When the [`AVAssetResourceLoadingRequest`](/documentation/AVFoundation/AVAssetResourceLoadingRequest) method [`finishLoading()`](/documentation/AVFoundation/AVAssetResourceLoadingRequest/finishLoading()) is invoked, the data request is considered fully satisfied. If the entire range of bytes requested has not yet been provided, the underlying media system assumes that the resource’s length is limited to the provided content.

## Topics

### Providing data to a request

[`respond(with:)`](/documentation/AVFoundation/AVAssetResourceLoadingDataRequest/respond(with:))

Provides data to the loading request.

[`requestedLength`](/documentation/AVFoundation/AVAssetResourceLoadingDataRequest/requestedLength)

The length, in bytes, of the data requested.

[`requestedOffset`](/documentation/AVFoundation/AVAssetResourceLoadingDataRequest/requestedOffset)

The position within the resource of the first byte requested.

[`currentOffset`](/documentation/AVFoundation/AVAssetResourceLoadingDataRequest/currentOffset)

The position within the resource of the next byte.

[`requestsAllDataToEndOfResource`](/documentation/AVFoundation/AVAssetResourceLoadingDataRequest/requestsAllDataToEndOfResource)

A Boolean value that indicates the entire remaining length of the resource from the offest to the end of the resource is being requested.



---

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)