---
title: "cancelRequest(withRequestID:)"
framework: photos
role: symbol
role_heading: Type Method
path: "photos/phlivephoto/cancelrequest(withrequestid:)"
---

# cancelRequest(withRequestID:)

Cancels an asynchronous request

## Declaration

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

## Parameters

- `requestID`: The numeric identifier of the request to be canceled.

## Discussion

Discussion When you use the 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:) method.

## See Also

### Loading a Live Photo from Data Files

- [request(withResourceFileURLs:placeholderImage:targetSize:contentMode:resultHandler:)](photos/phlivephoto/request(withresourcefileurls:placeholderimage:targetsize:contentmode:resulthandler:).md)
