2

I am working on an app written in Objective C. I have created some swift class and by creating the bridging header I am able to work with the swift file. Also, I am able to access the swift class from objective c class. Now I want to access the objective c class from the swift class but I am unable to do it. Please help to solve my problem

import UIKit

@objc class OptionsViewController: UIViewController {

override func viewDidLoad() {
    super.viewDidLoad()

    navigationController?.navigationBar.isHidden = true

}

//MARK:- Actions

@IBAction func cameraGalleryButtonWasPressed(_ sender: UIButton) {

let camera = CameraPickerViewController()
    self.navigationController?.pushViewController(camera, animated: true)
}

I am getting error like:-
Use of unresolved identifier CameraPickerViewController

sandpat
  • 1,478
  • 12
  • 30
Tapan Raut
  • 850
  • 6
  • 17
  • 1
    Did you import the .h file in the bridging file??? – MXNMike Apr 15 '20 at 20:18
  • when i am adding .file in bridging file. i am getting error in "CameraPickerViewController". like "'MyappName-Swift.h' file not found" – Tapan Raut Apr 15 '20 at 20:41
  • Possible duplicate of: [How do I call Objective-C code from Swift?](https://stackoverflow.com/questions/24002369/how-do-i-call-objective-c-code-from-swift) – TylerP Apr 15 '20 at 20:58

0 Answers0