3
@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)
}
我有一個錯誤說:類型的價值型 'AVCapturePhotoSettings' 沒有成員「availablePreviewPhotoPixelFormatTypes
值 'AVCapturePhotoSettings' 沒有成員 'availablePreviewPhotoPixelFormat'。
我使用的Xcode 9
在測試版5中還有'__availablePreviewPhotoPixelFormatTypes'。 – OOPer
非常感謝! – LogicFlow
我正在努力在beta 5中找到同樣的東西。 – Allamaprabhu