To include Objective C code in Swift application you use bridging-header. But it’s not available inside Framework.
The solution is to make your objc header public and expose it via framework’s public header.
Create OSX project, call it Frameworks. Next create CocoaFramework (File/New/Target…) and select Swift as a language.
Inside TestFramework create swift and objective classes:
We need to expose TestFrameworkObjc using TestFramework.h and to do that we need to change TestFrameworkObjc.h to public (in Target Membership)
After setting TestFrameworkObjc.h to public we can update framework’s umbrella public header by adding this objc header:
Import framework in our app’s view controller and test swift class using objective class:
Full code here:
Repository for medium post about using objective c and swift inside frameworks. - standinga/FrameworkSwiftObjc
Follow me on twitter :)