@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.