Contents

PHAssetVideoProgressHandler

The signature for a block that Photos calls while downloading asset data from iCloud. Used by the Progresshandler property.

Declaration

typealias PHAssetVideoProgressHandler = (Double, (any Error)?, UnsafeMutablePointer<ObjCBool>, [AnyHashable : Any]?) -> Void

Discussion

If you request a video asset whose data is not on the local device, and you 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.

error

An NSError object describing an error that occurred when attempting to download the video, or nil if no errors have occurred.

stop

A pointer to a Boolean value. To cancel the download, set *stop to true inside the block.

info

A dictionary providing additional information about the status of the video request. See Image Result Info Keys for possible keys and values.

See Also

Fetching Video Data from iCloud