当前位置 : 主页 > 手机开发 > 其它 >

swift4 – ‘AVCapturePhotoSettings’类型的值没有成员’availablePreviewPhotoPixelFormatTyp

来源:互联网 收集:自由互联 发布时间:2021-06-11
@objc func launchCoreML() { let settings = AVCapturePhotoSettings() let previewPixelType = settings.availablePreviewPhotoPixelFormatTypes.first let previewFormat = [ kCVPixelBufferPixelFormatTypeKey as String: previewPixelType, kCVPixelBuff
@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)
}

我有一个错误说:

Value of type ‘AVCapturePhotoSettings’ has no member
‘availablePreviewPhotoPixelFormat’.

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

在beta 4中,这被重命名为__availablePreviewPhotoPixelFormat.我还没看过beta 5.
网友评论