Initializer

init(from:)

Creates a unique photo settings object, copying all settings values from the specified photo settings object.

Declaration

convenience init(from photoSettings: AVCapturePhotoSettings)

Parameters

photoSettings

The photo settings object from which to copy settings.

Return Value

A new photo settings object.

Discussion

It is illegal to reuse a AVCapturePhotoSettings instance for multiple captures. Calling the capturePhoto(with:delegate:) method throws an exception if the uniqueID value of the settings parameter matches that of any previously used settings object.

To reuse a specific combination of settings, use this initializer to create a new AVCapturePhotoSettings instance from an existing photo settings object. The newly created instance has a new, unique value for its uniqueID property, but copies the values for all other properties from the photoSettings parameter.