<!--
{
  "availability" : [
    "iOS: 9.1.0 -",
    "iPadOS: 9.1.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PhotoKit",
  "identifier" : "/documentation/Photos/PHLivePhoto/cancelRequest(withRequestID:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Photos"
    ],
    "preciseIdentifier" : "c:objc(cs)PHLivePhoto(cm)cancelLivePhotoRequestWithRequestID:"
  },
  "title" : "cancelRequest(withRequestID:)"
}
-->

# cancelRequest(withRequestID:)

Cancels an asynchronous request

```
class func cancelRequest(withRequestID requestID: PHLivePhotoRequestID)
```

## Parameters

`requestID`

The numeric identifier of the request to be canceled.

## Discussion

When you use the [`request(withResourceFileURLs:placeholderImage:targetSize:contentMode:resultHandler:)`](/documentation/Photos/PHLivePhoto/request(withResourceFileURLs:placeholderImage:targetSize:contentMode:resultHandler:)) method to asynchronously load a Live Photo from resource files, the method returns a numeric identifier for the request. To cancel the request before it completes, provide the identifier when calling the [`cancelRequest(withRequestID:)`](/documentation/Photos/PHLivePhoto/cancelRequest(withRequestID:)) 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)