Methods for monitoring progress and receiving results from a photo capture output.
- iOS 10.0+
- macOS 10.15+
- Mac Catalyst 13.0+
You implement methods in the
AVCapture protocol to be notified of progress and results when capturing photos with the
To capture a photo, you pass an object implementing this protocol to the
capture method, along with a settings object that describes the capture to be performed. As the capture proceeds, the photo output calls several of the methods in this protocol on your delegate object, providing information about the capture’s progress and delivering the resulting photos.
Which delegate methods the photo output calls depends on the photo settings you initiate capture with. All methods in this protocol are optional at compile time, but at run time your delegate object must respond to certain methods depending on your photo settings:
If you request a still photo capture (by specifying image formats or file types), your delegate either must implement the
photomethod, or must implement methods listed in Receiving Capture Results (Deprecated) corresponding to whether you request capture in RAW format, processed format, or both.
Output(_: did Finish Processing Photo: error:)
If you request Live Photo capture (by setting the
liveproperty to a non-
Photo Movie File URL
nilvalue), your delegate must implement the
Output(_: did Finish Processing Live Photo To Movie File At: duration: photo Display Time: resolved Settings: error:)
The capture output validates these requirements when you call the
capture method. If your delegate does not meet these requirements, that method raises an exception.
You must use a unique
AVCapture object for each capture request. When the photo output calls your delegate methods, it provides an
AVCapture object whose
unique property matches that of the photo settings you requested capture with. When making multiple captures, use this unique ID to determine which delegate method calls correspond to which requests.
The photo output always calls each method listed in Monitoring Capture Progress exactly once for each capture request. For methods listed in Receiving Capture Results, you may receive a call more than once, or not at all, depending on your photo settings. See the description of each method for details.