Updating an existing Bridging-Header file

I'm looking for some help with XCode 8 Beta 3.


I have an existing *-Bridging-Header.h in my OS X project with a single import statement. The file currently references a single .h file correctly (the app builds and runs in both Xocde 7 and Xcode 8). The existing project was initially migrated from XCode 7 to XCode 8. After migrating the project to XCode 8, and Swift 3, I updated the Bridging-Header.h file with an additional .h file (I also added the associated .h and .m files to the project), and the app will build successfully (just updating the Bridging-Header file and the class defined in the new .h isn't referenced in any of the Swift code). If I use the new class defined in the in the new .h file in the existing Objective-C file, the app builds and runs. However, I get a compile error (unresolved identifier) as soon I as try to use the new class in a Swift class.


I've also done the exact same process (adding a new .h and .m files) to the the project, and updating the Bridging-Header.h in XCode 7, and I am able to then reference the class defined in the new .h file in my Swift class (the app builds and runs).


There seems to be an issue with XCode 8 Beta and updating the Bridging-Header file.


Any suggestions on how to fix the problem?

It’s hard to say what’s going on here without more information. I recommend that you create a new project using one of the standard templates and try to reproduce the problem there. If so, post the steps you took and we can take a look. If not, you know there’s something specific to your project that’s causing the issue.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks for the suggestion. I found the problem, and it was my own fault. The Swift file that was referencing the Obj-C classes had multiple targets, and not every target had been configured with the bridge header file. Thanks for your help.

Updating an existing Bridging-Header file
 
 
Q