3

I have recently added a Swift file to my Objective-C only project. Xcode created the necessary header files, including the Objective-C Generated Interface Header. Everything works fine if I #import this header file "myProject-Swift.h" to the .m file where I am accessing the Swift class I have added.

However I will want to eventually use this Swift class throughout my project, and to avoid importing it every single time, I wanted to add this myProject-Swift.h import file to my .pch prefix file.

However when I try to build my app after having added this, I get a 'myProject-Swift.h' file not found error and the build fails.

Does this mean it is not possible to import this myProject-Swift.h in a .pch file?

Is it really only possible to do it in each .m file individually?

Dana
  • 435
  • 1
  • 4
  • 13

0 Answers0