Reputation: 27275
I have a dynamic framework in swift that currently is linking in another framework that is written in Objective C. This works but its annoying because the Objective C framework really only 2 files and I was wondering if there is a way to bring this into my swift framework.
If this was an application I'd user Bridging-Header but that is not supported inside a swift framework.
My framework is called GDL90 and consists of only swift files.
My Objective-C framework consists of:
GeoidCalculator.h
GeoidCalculator.m
EGM96
(data file)CORCOEF
(data file)Real simple - right? So I wanted to see if there was a way to just add this code into my swift project.
GDL90.h
I added my file an get the warning Include of non-modular header inside framework module 'GDL90'
Ok so thats no dice.
I figured I needed to make a module map file.
So I made a directory called ${SRCROOT}/GDL90/EGM96
and inside I created EGM96.module.modulemap
module EGM96 {
header "GeoidCalculator.h"
export *
}
And then in one of my swift files i have import EGM96
which doesn't seem to be found.
In my build settings i have:
Define Modules
turned on and I'm pointing to the modulemap
file from my Module Map File item
Am I missing something??
Upvotes: 3
Views: 1044
Reputation: 479
You do not need the modulemap files if create internal framework correctly:
Add objective-с files and other sources of EGM96 to new target.
Add GeoidCalculator.h as public header:
import EGM96
Upvotes: 2