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.