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.0indicates the download has just started, and a value of1.0indicates the download is complete.- stop
A pointer to a Boolean value. Set
*stoptotrueinside the block to cancel the download.