I created a Swift pod (podspec) which depends on a pod written in Objective-C. In my podspec I use:
s.dependency 'ObjectiveCPod', '~>3.2.1'
To specify the dependent pod. To use it I need a bridging header being installed automatically when my Swift pod is installed. I do not want to create a bridging header in my project myself to integrate the objective-c pods header files.
How can I configure my podspec such that a bridging header file is automatically integrated and linked in my project when I install my Swift pod?
CocoaPods generates an umbrella header for the framework created for your Swift pod. This imports all public headers defined in the podspec. Everything, which is transitively imported from your umbrella header, is available in the Clang module of your framework. So just add a header to your project, which imports whatever is needed from your Objective-C dependency and declare it as public header in your podspec.
If you have a project to build and test your pod, you still want to import that header in the default umbrella header, which has by default the same name as your framework and is part of the template from Xcode.
Alternatively, you should be able to import the Objective-C dependency by using @import ObjectiveCPod
from Swift.
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