奇怪的是,这在Swift 4中会是什么?stimageout = AVCapturePhotoOutput() stimageout?.outputSettings = [AVVideoCodecKey : AVVideoCodecJPEG]
目前,它的错误与Value of type 'AVCapturePhotoOutput' has no member 'outputSettings',这是奇怪的,因为我没有记忆苹果改变这一点。
这不是“乞求帮助”的-type问题。我只是好奇,如果苹果改变了这个和我需要做的步骤,以解决这个问题。
提前谢谢。:)
发布于 2017-10-08 23:02:05
问题是outputSettings是AVCaptureStillImageOutput上的一个属性,而不是AVCapturePhotoOutput。
AVCaptureStillImageOutput在iOS 10中被废弃,因此对于iOS 10+,使用AVCapturePhotoOutput代替。若要使用新API设置设置,可以使用AVCapturePhotoSettings对象。
let stimageout = AVCapturePhotoOutput()
let settings = AVCapturePhotoSettings()
settings.livePhotoVideoCodecType = .jpeg
stimageout.capturePhoto(with: settings, delegate: self)苹果的AVCapturePhotoOutput文档:https://developer.apple.com/documentation/avfoundation/avcapturephotooutput
https://stackoverflow.com/questions/46636742
复制相似问题