2017-12-29 26 views
1

私は別の開発者のコ​​ードで作業しています。これはカメラアプリです。私はそれに働いたと私はXcodeの9にアップグレードする前に、以下のコードは正常に動作してXcode 8をXCode 9にアップグレードした後のAvCaptureエラー

@objc protocol AVCapturePhotoOutputType { 
@available(iOS 10.0, *) 
var isLensStabilizationDuringBracketedCaptureSupported: Bool {get} 
@available(iOS 10.0, *) 
var availableRawPhotoPixelFormatTypes: [Int] {get} 
@available(iOS 10.0, *) 
var isHighResolutionCaptureEnabled: Bool {get 
@objc(setHighResolutionCaptureEnabled:) set} 
@available(iOS 10.0, *) 
var supportedFlashModes: [Int] {get} 
@available(iOS 10.0, *) 
func connection(withMediaType mediaType: String!) -> AVCaptureConnection! 
@available(iOS 10.0, *) 
@objc(capturePhotoWithSettings:delegate:) 
func capturePhoto(with settings: AVCapturePhotoSettings, delegate: 
AVCapturePhotoCaptureDelegate)} 

@available(iOS 10.0, *) 
extension AVCapturePhotoOutput:AVCapturePhotoOutputType {} 
今、私はラインの延長AVCapturePhotoOutput上のエラーを取得しています

:AVCapturePhotoOutputType {}すなわち拡張protocol.Thisを誤り

です
Type 'AVCapturePhotoOutput' does not conform to protocol 'AVCapturePhotoOutputType' 

xCodeは、自動修正オプションも提供しています.2つのスタブが生成され、以下の図のようにエラーが発生します。

Errors after adding stubs

私はそれが任意の助けが理解されるであろう、Xcodeの9にアップグレードした後に起こった理由を認識できませんでした。

答えて

1

全く同じ問題がありました。ただ、

:-)このプロトコルで

@objc protocol AVCapturePhotoOutputType { 
@available(iOS 10.0, *) 
var isLensStabilizationDuringBracketedCaptureSupported: Bool {get} 
//### `availableRawPhotoPixelFormatTypes` is temporarily renamed to `__availableRawPhotoPixelFormatTypes`, 
//### Maybe more Swiftish refinement is planned, but not yet completed. 
@available(iOS 10.0, *) 
@objc(availableRawPhotoPixelFormatTypes) 
var __availableRawPhotoPixelFormatTypes: [NSNumber] {get} 
@available(iOS 10.0, *) 
var isHighResolutionCaptureEnabled: Bool {get @objc(setHighResolutionCaptureEnabled:) set} 
@available(iOS 10.0, *) 
//### `supportedFlashModes` is temporarily renamed to `__supportedFlashModes`, 
//### Maybe more Swiftish refinement is planned, but not yet completed. 
@objc(supportedFlashModes) 
var __supportedFlashModes: [NSNumber] {get} 
@available(iOS 10.0, *) 
@objc(connectionWithMediaType:) 
func connection(with mediaType: AVMediaType) -> AVCaptureConnection? 
@available(iOS 10.0, *) 
@objc(capturePhotoWithSettings:delegate:) 
func capturePhoto(with settings: AVCapturePhotoSettings, delegate: AVCapturePhotoCaptureDelegate) 
} 

歓声をあなたのプロトコルを置き換えます

関連する問題