Building a framework that supports iOS/macOS - recommendation?
-
I'm building a small SDK that is multi-platform (linux/windows/macOS/Android/iOS) - and as I begin planning the API interface, I'm wondering what are some of the best approaches to making the API consumable on platforms that are not comfortable with things like std::string as an argument type.
For example, on iOS and macOS I'm building the SDK as a dynamic framework (thanks Qt for already handling this!) because I want it consumable from Swift.
I don't have much experience with Swift, so I'm unsure how best to (presumably) wrap my C++ SDK public headers into something Swift appropriate.
Basically along the lines of prepping:
bool createSomeObject( const std::string& sSomeExampleStringData );
Sorry if this is crazy noobilicious, but I'm just getting started on Swift and haven't done any non-Swift integrations yet.
-
Well, that's basically just talking about the idea that Swift can use a C library, so just extern "C" your C++ code.
It doesn't talk about marshaling, managing types, objects, lifecycles, et cetera.
This is why I was asking about passing a string in and/or receiving a string back - and wondering what someone (surely someone here has done this) would recommend as an approach.