<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PhotoKit",
  "identifier" : "/documentation/Photos/PHAssetResourceManager/cancelDataRequest(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Photos"
    ],
    "preciseIdentifier" : "c:objc(cs)PHAssetResourceManager(im)cancelDataRequest:"
  },
  "title" : "cancelDataRequest(_:)"
}
-->

# cancelDataRequest(_:)

Cancels an asynchronous request.

```
func cancelDataRequest(_ requestID: PHAssetResourceDataRequestID)
```

## Parameters

`requestID`

The numeric identifier of the request to be canceled.

## Discussion

When you perform an asynchronous request for asset resource data using the [`requestData(for:options:dataReceivedHandler:completionHandler:)`](/documentation/Photos/PHAssetResourceManager/requestData(for:options:dataReceivedHandler:completionHandler:)) method, the image manager returns a numeric identifier for the request. To cancel the request before it completes, provide this identifier when calling the [`cancelDataRequest(_:)`](/documentation/Photos/PHAssetResourceManager/cancelDataRequest(_:)) method.

---

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)