2

My swift cocoa touch framework contains the subproject, which is an Objective-C static library. (WhirlyGlobe-MaplyComponent).

Now, I wish to expose its classes to my swift code.
If I just add #include "MaplyComponent.h" into the umbrella header, I will get Include of non-modular header inside framework module even when Allow Non-modular Includes In The Framework Modules is set to YES in the build settings.

Another way: Some post shows how to create a module.map file in order to wrap the header into Swift module, I did exactly the same:

module MaplyComponent [system] {
    header "/Users/hurden/Developer/repositories/OSMViewer/OSMKit/WhirlyGlobe/WhirlyGlobeSrc/WhirlyGlobe-MaplyComponent/include/MaplyComponent.h"
    export *
}

Then import MaplyComponent will make everything work, I can call the API, run and test, but Xcode's SourceKitService won't be able to parse the actual headers - no code completion, variable type is <<error-type>> and so on, so It seems to me it is not the proper way.

Any suggestions? (There definitely should be the way how I can import the header of the subproject in the umbrella header)

UPDATE:
I could resolve an issue with linking the binary distribution instead of the source one. (However it involves horrible header copying from inside of the framework to the project. Link to original answer.)

Community
  • 1
  • 1
ambientlight
  • 7,212
  • 3
  • 49
  • 61

0 Answers0