<!--
{
  "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/respond(with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAssetResourceLoadingDataRequest(im)respondWithData:"
  },
  "title" : "respond(with:)"
}
-->

# respond(with:)

Provides data to the loading request.

```
func respond(with data: Data)
```

## Parameters

`data`

An instance of NSData containing some or all of the requested bytes.

## Discussion

This method may be invoked multiple times on the same instance of `AVAssetResourceLoadingDataRequest` to provide the full range of requested data incrementally. Upon each invocation, the value of the [`currentOffset`](/documentation/AVFoundation/AVAssetResourceLoadingDataRequest/currentOffset) property is updated to match the amount of data provided.

The system can retain the data you provide and keep processing it for an indefinite period after this method returns. Don’t modify that data after you share its contents. If you manage your own memory pool, create the data with `init(bytesNoCopy:count:deallocator:)`, and its deallocator signals the earliest moment when reusing the memory is safe.

---

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)