I am working on an app in Objective C. I added the the StoreKit framework with the logic using swift. everything worked as planned except for when I wanted to access properties and methods from my ObjC ViewController in the swift code. I did everything as is directed in the apple developer documentation, except it didn't work. I kept receiving the following errors;
- failed to emit precompiled bridging header
- ViewController.h file not found ( for the import code in the bridging header)
I spent a whole day perusing the internet for a solution. Unfortunately, nothing worked. I thought I should try to import other classes from the ObjC into the bridging header. When I imported 3 files the 3rd one took after commenting out the 2 above it. Then I imported the ViewController again and the build was successful. I deleted every imported file above the file that I need to make visible to the swift compiler leaving the empty lines above it. Apparently, I was getting the errors because my import code was on line 4 instead of line 9, although the file is completely empty except for the comments created by Xcode when the file was automatically created.
I am not sure why the placement of the line of code holds that much weight when the file is empty?
**Can anyone explain to me any technicality that would lead to this issue? **