---
title: "cancelImageRequest(_:)"
framework: photos
role: symbol
role_heading: Instance Method
path: "photos/phimagemanager/cancelimagerequest(_:)"
---

# cancelImageRequest(_:)

Cancels an asynchronous request

## Declaration

```swift
func cancelImageRequest(_ requestID: PHImageRequestID)
```

## Parameters

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

## Discussion

Discussion When you perform an asynchronous request for image data using the requestImage(for:targetSize:contentMode:options:resultHandler:) method, or for a video object using one of the methods listed in Requesting Video Objects, the image manager returns a numeric identifier for the request. To cancel the request before it completes, provide this identifier when calling the cancelImageRequest(_:) method.

## See Also

### Canceling a Request

- [PHImageRequestID](photos/phimagerequestid.md)
- [PHInvalidImageRequestID](photos/phinvalidimagerequestid.md)
