0

I downloaded this Xcode project and I want to use my Swift files in the Objective-C files but the 'OpenShop-Swift.h' file not found error refuses to go away.

I have tried what seems like every solution on Stack Overflow, including from here and here. Most other solutions were duplicates of the common:

In build settings, set defines module to yes and product module name for the target to your project name and make sure objective-c generated interface header name is correct.

This top solution seemed promising but I am having trouble understanding what he was saying.

If you decide to give it a whirl, just know that the project lacks a working backend and won't compile properly if you get past the file not found error. But, if you add to one of the .m files you should be able to get the error before the project finishes compiling.

Technically, this is not a duplicate since all the other solutions have failed.

shim
  • 9,289
  • 12
  • 69
  • 108
Bobby Zhang
  • 205
  • 2
  • 6
  • 11
  • I cannot reproduce your issue. I downloaded that codebase and added a Swift file. I was then able to build and access OpenShop-Swift.h. Go through those answers again to see if there's something you missed. Did you add a bridging header and define it in the build settings? – Sean Kladek Jul 09 '18 at 16:06

1 Answers1

0

I have found the solution thanks to @skladek. I created a swift file and allowed Xcode to create a bridging header file for me when it asked, and the error went away.

I thought the bridging header file (OpenShop-Bridging-Header.h) was to allow the importation of Obj-C code to Swift files and not vice-versa. Thus far everything I have read on the internet has corroborated this, so it's not clear to me why this solution works. Thanks to @skladek once again.

Bobby Zhang
  • 205
  • 2
  • 6
  • 11