Lexical or Preprocessor issue in interoperability of objective c and swift class

I have an objective c project. I am adding the swift class and then i go to my objective c .m file and add the swift class header. I am getting a Lexical and Preprocessor error when adding my .h file in my objective c project. The message error saying “Myclassname-Swift.h” not found! What am i missing?

This is my swift class. Test is the name of the swift class. So inside my objective c .m file class i add #import “Test-Swift.h”

import Foundation
import UIKit

@objc public class Test:UIViewController
{

@objc func showHelloWorld(){
print("hello world");
}

}

This topic was automatically closed after 166 days. New replies are no longer allowed.