Reputation: 3202
I get the following snippet:
let newPhotoSettings = AVCapturePhotoSettings(rawPixelFormatType: OSType(self.photoOutput.availableRawPhotoPixelFormatTypes.first!), processedFormat: nil)
When I build in Xcode 12 beta 6, I get the following error:
Value of type 'AVCapturePhotoOutput' has no member 'availableRawPhotoPixelFormatTypes'
When I check the API documentation (here), it does not show availableRawPhotoPixelFormatTypes
as deprecated.
Anyone else has this issue?
The above errors are only present when I try to render SwiftUI preview for Home Screen Widget. If I run the project normally, it runs perfectly fine without errors.
Also, I am getting same error for preview pixel types:
photoSettings.previewPhotoFormat = [kCVPixelBufferPixelFormatTypeKey as String: photoSettings.availablePreviewPhotoPixelFormatTypes[0]]
Value of type 'AVCapturePhotoSettings' has no member 'availablePreviewPhotoPixelFormatTypes'
Upvotes: 2
Views: 551
Reputation: 10418
It seems this is now split into two queries:
Use availableRawPhotoFileTypes
to get the supported RAW file types, choose one of them, and then ask for the corresponding supported format types with supportedRawPhotoPixelFormatTypes(for fileType: AVFileType)
.
I think right now only DNG files are supported in iOS, but separating the APIs is probably more future-proof.
Upvotes: 2