After updating to CocoaPods 0.36.x, I am unable to add imports into my Bridging-Header.h file. I get the "DBSphereView.h file not found".
The file is indeed present in:
"Pods/DBSphereTagCloud/DBSphereView.h" "Headers/public/DBSphereTagCloud/DBSphereView.h" "Headers/private/DBSphereTagCloud/DBSphereView.h"
My bridge file:
#ifndef Loan_Bridging_Header_h #define Loan_Bridging_Header_h #import "DBSphereView.h" #endif
I am able to use Frameworks. I have a reference to a well known Framework (Alamofire), and it works great!
My podfile:
source 'https://github.com/CocoaPods/Specs.git' use_frameworks! pod 'DBSphereTagCloud', '~> 1.0' pod 'Alamofire', '~> 1.1'
Before updating, I had no problems with importing header files.
How do I reference header files in Bridging-Header.h after updating CocoaPods to 0.36.x?
Thank you!
EDIT:
I also tried to create a separate project based on the example "Get Started" from cocoapods.org, without success. After using Frameworks, I can't seem to reference header files in my bridging header file. I must be missing some detail?
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.
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.
In your Podfile
, you specified use_frameworks!
.
As a result, the Objective-C code you're including as a dependency (DBSphereTagCloud
) is packaged as a framework, instead of a static library. Please see CocoaPods 0.36 - Framework and Swift Support for more details.
As a consequence, you don't need a bridging header file. It's enough for you to add:
import DBSphereTagCloud
in all the Swift files that need that module.
I had problems with this. My bridging header wasn't finding pod libs. I ended up finding out that I have to do this.
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