刚刚安装了最新的 XCode 版本,该版本在 AVCapturePhotoOutput 类中提供了一些更改,我想知道如何获取支持的 Flash 模式列表。在以前的版本中,我使用了 supportedFlashModes
属性,该属性不再可用
open var __supportedFlashModes: [NSNumber] { get }
最佳答案
我猜新的 Swiftified supportedFlashModes
属性已计划在 beta 5 中使用,但尚未完成。
open var supportedFlashModes: [AVCaptureDevice.FlashMode] { get }
在我的猜测得到证实(可能为负)之前,您可以使用__supportedFlashModes
。它没有被删除,只是被重命名。
(某些测试版包含这种正在 build 中的重命名。)
您最好发送错误报告,让 Apple 了解此问题。
编辑 似乎 iOS 11 SDK/Xcode 9.1 已经解决了这个问题,Xcode 9.1 beta 的发行说明说:
- The following AVFoundation API are now available:
AVCaptureDevice.Format.supportedColorSpaces
AVCaptureDevice.supportedFlashModes
AVCapturePhotoOutput.availablePhotoPixelFormatTypes
AVCapturePhotoOutput.availableRawPhotoPixelFormatTypes
AVCapturePhotoSettings.availablePreviewPhotoPixelFormatTypes
Code which was previously modified to use a double underscore as a workaround should be modified to use these public symbols or the app may be rejected by the App Store.
(添加粗体样式。)
关于swift - AVCapturePhotoOutput - Xcode 9 Beta 5 中的更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45555134/