Post not yet marked as solved
Post marked as unsolved with 4 replies, 3,229 views
Hi,
I am writing a Swift framework that primarily serves as a wrapper for a linear algebra library written in C. The framework therefore is a mixture of Swift and Objective C (the Objective C part is there to serve as a bridge to allow the Swift code to talk to the C
I have reviewed the documents on Clang modules and looked at various code examples on the Web. However, I am still not finding a clear path and have had difficulties getting the code to compile (I am also unclear what the official recommendations are for achieving the goal I desire). Here are a few questions:
1) Is it good practice to create mixed languages frameworks that are a combination of Swift and Objective C++? If so, are there examples available that show best practices? If not, what is a workaround?
2) I don’t want to expose the Objective C++ part of the code to the consumer of my framework. I am not clear how to do this. I have read about private modules. However, I am unclear about how to properly use private modules in this context and again lack clear examples.
3) What is the recommended practice when creating module.map files in XCode when XCode itself generates a default module.map file when building a framework? Again, there are some examples on the Web, but I am unclear whether they are correct an none of them explicitly suits my goals.
4) Where is the official documentation on how to properly use module.map files in XCode especially with respect to building frameworks that rely on both Swift and Objective C++?
5) Although I know that if this weren’t a framework, I could create a bridging header to allow Swift to talk to Objective C++. However, in the case of a module there is an umbrella header. My understanding of the umbrella header is that it pertains to code that will consume the framework, not for other code in the framework itself. Can you somehow combine an umbrella header and a bridging header in a framework?
Thanks in advance