Contents

progressHandler

A block Photos calls periodically while downloading the asset.

Declaration

var progressHandler: ((Double, UnsafeMutablePointer<ObjCBool>) -> Void)? { get set }

Discussion

If you request an asset whose data is not on the local device, and have enabled downloading with the isNetworkAccessAllowed property, Photos calls your block periodically to report progress and allow canceling the download.

The block takes the following parameters:

progress

A floating-point value indicating the progress of the download. A value of 0.0 indicates the download has just started, and a value of 1.0 indicates the download is complete.

stop

A pointer to a Boolean value. Set *stop to true inside the block to cancel the download.

See Also

Fetching Asset Data from iCloud