I have a Swift project for which I'm trying to import ObjC-based frameworks. The framework is located in a directory under the project's path and is referenced by the project in Xcode. It's also added to the "Link Binary with Libraries" in the project's 'Build Phases' page.
However, for some reason, I can't seem to include the framework in the Bridging-Header file. I get the following error:
BridgingHeader.h:5:9: error: 'Parse/Parse.h' file not found #import <Parse/Parse.h> ^ <unknown>:0: error: failed to import bridging header 'BridgingHeader.h'
Things I've checked:
I'm sure I'm missing something, so if anyone has any clues, that would be great.
Alternatively, you can create a bridging header yourself by choosing File > New > File > [operating system] > Source > Header File. Edit the bridging header to expose your Objective-C code to your Swift code: In your Objective-C bridging header, import every Objective-C header you want to expose to Swift.
To create an Objective-C bridging header file, all you need to do is drag some Objective-C code into your Swift project – Xcode should prompt you with the message "Would you like to configure an Objective-C bridging header?" Click "Creating Bridging Header" and you'll see a file called YourProjectName-Bridging-Header.
Add any Objective-C file to your Swift project by choosing File -> New -> New File -> Objective-C File. Upon saving, Xcode will ask if you want to add a bridging header. Choose 'Yes'.
Found a solution:
SWIFT_OBJC_BRIDGING_HEADER
) must be set at the Target level, and NOT the Project level. Be sure to delete the setting value at the Project level.(to me, it seems like an Xcode bug, since I don't know why it fixes it).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With