Contents

photoOutput(_:didFinishCapturingDeferredPhotoProxy:error:)

Tells the delegate when the system finishes capturing the photo proxy.

Declaration

optional func photoOutput(_ output: AVCapturePhotoOutput, didFinishCapturingDeferredPhotoProxy deferredPhotoProxy: AVCaptureDeferredPhotoProxy?, error: (any Error)?)

Parameters

  • output:

    The output instance.

  • deferredPhotoProxy:

    A Avcapturedeferredphotoproxy instance that contains a proxy Cvpixelbuffer Q2e as a placeholder for the final image.

  • error:

    If the system couldn’t create the photo proxy, or any of the underlying intermediate files, an error object that describes the failure.

Discussion

You can use the output’s fileDataRepresentation() with PHAssetCreationRequest to eventually produce the final, processed photo into the user’s Photo Library. Add the in-memory proxy file data representation to the photo library as quickly as possible after this call to ensure that the photo library can begin background processing. It’s also important so that the intermediates aren’t removed by a periodic clean-up job looking for abandoned intermediates produced by using the deferred photo processing APIs.

Your delegate implementation must adopt this method to opt into deferred photo processing, otherwise calling capturePhoto(with:delegate:) throws an exception.

See Also

Receiving capture results