How to use Objective C bridging header in swift framework?

2.4k Views Asked by At

I have created my own cocoa POD framework in swift, which uses #import CommonCrypto/CommonCrypto.h in Objective C bridging header file, but when I try to use same POD in project, It gives compile error -

Include of non-modular header inside framework module '': '/Users/macmini/Downloads/Xcode_9.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/usr/include/CommonCrypto/CommonCrypto.h'"

Please let me know how I can fix the same.

I am using this for creating my own POD framework in swift.

1

There are 1 best solutions below

2
Geeta Khati On

Go to Project Target -> Build Settings -> search for "Modules" -> Set "Allow Non-modular Includes In Framework Modules" to Yes.

This will allow you to use Objective C bridging header file in your project.