0
votes

I'm using a Swift file, a sub-class of UIViewController in a project which is basically built previously in Objective-C. The bridging-header file is added by Xcode. I'm getting following error:

Cannot find protocol declaration for 'AVCapturePhotoCaptureDelegate'

This is my VC:

import UIKit
import AVFoundation

class ScanTargetAVFViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
    }
}

extension ScanTargetAVFViewController: AVCapturePhotoCaptureDelegate {

}

EDIT:

I've tried removing #import "MyProject-Swift.h" from one of the objective-c file and it works now. However, I need to reference Swift code from my Objective-C files. Any clue?

1

1 Answers

0
votes

Try importing the MyProject-Swift.h file into MyObjectiveC.m rather than MyObjectiveC.h. If there are Swift classes you need to reference in MyObjectiveC.h you can use the class directive.

@class MySwiftClass;