---
title: requestedLength
framework: avfoundation
role: symbol
role_heading: Instance Property
path: avfoundation/avassetresourceloadingdatarequest/requestedlength
---

# requestedLength

The length, in bytes, of the data requested.

## Declaration

```swift
var requestedLength: Int { get }
```

## Discussion

Discussion If the content length of the resource is unknown, the sum of the requestedLength and requestedOffset properties may be greater than the actual content length. When this situation occurs, an application must attempt to provide as much of the requested data beginning at the requestedOffset property as the resource contains. The application must then invoke either the AVAssetResourceLoadingRequest instance’s finishLoading() method upon success, or the finishLoading(with:) method if an error is encountered during the loading.

## See Also

### Providing data to a request

- [respond(with:)](avfoundation/avassetresourceloadingdatarequest/respond(with:).md)
- [requestedOffset](avfoundation/avassetresourceloadingdatarequest/requestedoffset.md)
- [currentOffset](avfoundation/avassetresourceloadingdatarequest/currentoffset.md)
- [requestsAllDataToEndOfResource](avfoundation/avassetresourceloadingdatarequest/requestsalldatatoendofresource.md)
