---
title: "resourceLoader(_:didCancel:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avassetresourceloaderdelegate/resourceloader(_:didcancel:)-3nl51"
---

# resourceLoader(_:didCancel:)

Informs the delegate that a prior loading request has been cancelled.

## Declaration

```swift
optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, didCancel loadingRequest: AVAssetResourceLoadingRequest)
```

## Parameters

- `resourceLoader`: The resource loader.
- `loadingRequest`: The loading request that has been cancelled.

## Discussion

Discussion Previously issued loading requests can be cancelled when data from the resource is no longer required or when a loading request is superseded by new requests for data from the same resource. For example, if to complete a seek operation it becomes necessary to load a range of bytes that’s different from a range previously requested, the prior request may be cancelled while the delegate is still handling it.

## See Also

### Processing resource requests

- [resourceLoader(_:shouldWaitForLoadingOfRequestedResource:)](avfoundation/avassetresourceloaderdelegate/resourceloader(_:shouldwaitforloadingofrequestedresource:).md)
- [resourceLoader(_:shouldWaitForRenewalOfRequestedResource:)](avfoundation/avassetresourceloaderdelegate/resourceloader(_:shouldwaitforrenewalofrequestedresource:).md)
