I’m pretty sure there are lot of tutorials about mixing ObjectiveC with Swift in both ways. But most of them are covering only normal projects. If you have framework in which you need to mix both languages, you cannot create simple bridging header because you will hit “using bridging headers with framework targets is unsupported” error. What to do then?
Solution is very simple but not obvious. Usually all tutorials says you need to
#import "MyFramework-Swift.h"
but XCode will always show this file is not exists. So first you need to remove automatically created bridging header from here:
and leave only this:
And the most important thing, in your .m file use:
#import <MyFramework/MyFramework-Swift.h>
Then everything will just compile.
I tried but it didn’t work
I have solved it in this way, Detailed steps are here, https://handyopinion.com/xcode-error-using-bridging-headers-with-module-interfaces-is-unsupported
Solution:
In your Project Level & Target level Build Settings tab, open the Build Options menu. And then set Build Libraries for Distribution option to No.
I tried but it didn’t work i think this is not the correct solution.