Instance Method


Cancels an asynchronous request


func cancelImageRequest(_ requestID: PHImageRequestID)



The numeric identifier of the request to be canceled.


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

typealias PHImageRequestID

A numeric identifier for an asynchronous image request.

let PHInvalidImageRequestID: PHImageRequestID

A special value provided for asynchronous image requests that cannot be canceled.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software