I've worked out a perfectly manageable answer. How can I instantiate and manipulate a C++ Class from within Swift? I can't seem to find anything published on this. Swift code can now call functions directly let type = omCString(imageType(filename)) To bridge to a C++ function, the following works fine:ĭefine a bridging header through "C" #ifndef ImageReader_hpp There are other questions asking, "How do I call a C++ function from Swift." This is not my question. Effectively, I'm just creating a Swift based UI to allow the core functionality to work under OS X. The primary motivation is that the C++ code represents a core library that is used on multiple platforms. I'm trying to make use of them through some type of bridge within Swift rather than rewrite them as Swift code. I have a significant library of classes written in C++.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |