2017-12-29 6 views
1

다른 개발자의 코드를 작성 중이므로 카메라 앱입니다. 나는 그것에 근무하고 내가 엑스 코드 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는 자동 수정을위한 옵션도 제공합니다. xCode는 두 개의 스텁이 생성되고 아래의 그림과 같이 오류가 발생하기 시작할 때 적용됩니다. 나는 그것이 엑스 코드 9로 업그레이드 한 후 일어난 이유를 인식하지 못했습니다

Errors after adding stubs

, 어떤 도움을 이해할 수있을 것이다.

답변

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) 
} 

환호를 당신의 프로토콜을 대체

관련 문제