As I explained in image I want to create Pod lib in swift which have another Pod lib dependency written in Objective-c.
Now I know that to use objective-c code in swift we need bridge file and I created it too.
but When I set it into Pod's build phase I got this error<unknown>:0: error: using bridging headers with framework targets is unsupported
I got hint in internet that I should put .h file into pod-umbrella.h file, But that also gave me error Include of non-modular header inside framework module 'DemoPod'
Here is my demopod project for you if you want to play around.
Demo Pod Project
EDIT As per Ashsis suggestion I added below code into DemoPod.modulemap
framework module AdaptiveCard {
umbrella header "/Users/jageen.shukla/Documents/Project/ai answer/DemoPod/Example/Pods/AdaptiveCards/AdaptiveCards.framework/Headers/ACFramework.h"
requires ios
export *
}
But still I can not build project because it give me error in target project that can not find module "AdaptiveCard".
I change code in DemoPod.modulemap
framework module DemoPod {
umbrella header "DemoPod-umbrella.h"
// Solution 2
framework module AdaptiveCard {
umbrella header "/Users/jageen.shukla/Downloads/DemoPod/Example/Pods/AdaptiveCards/AdaptiveCards.framework/Headers/ACFramework.h"
export *
module * { export * }
}
// ----
export *
module * { export * }
}
Bridging header is only recommended at App Target and App Test target to access objective c and CPP files in swift. You should use modulemap to expose the Objc and CPP functionality to swift library when it comes to static library or framework. Please check the code implementation how to use modulemap here: https://github.com/ashislaha/Swift-ObjectiveC-Interoperability