小编Log*_*low的帖子

"AVCapturePhotoSettings"类型的值没有成员'availablePreviewPhotoPixelFormatTypes

@objc func launchCoreML() {
    let settings = AVCapturePhotoSettings()
    let previewPixelType = settings.availablePreviewPhotoPixelFormatTypes.first
    let previewFormat = [
        kCVPixelBufferPixelFormatTypeKey as String: previewPixelType, 
        kCVPixelBufferWidthKey as String: 160, 
        kCVPixelBufferHeightKey as String: 160
    ] as [String : Any]

    settings.previewPhotoFormat = previewFormat
    cameraOutput.capturePhoto(with: settings, delegate: self)
}
Run Code Online (Sandbox Code Playgroud)

我有一个错误说:

"AVCapturePhotoSettings"类型的值没有成员'availablePreviewPhotoPixelFormat'.

我正在使用Xcode 9的测试版.

swift4 coreml xcode9

4
推荐指数
2
解决办法
1109
查看次数

标签 统计

coreml ×1

swift4 ×1

xcode9 ×1